Music listening counter

For starters NaN means not a number.
https://www.w3schools.com/jsref/jsref_number_nan.asp

Are you storing your dataset field for this value as number of text, if it number then you will need to add toString to make it a text string for your text box on your page.
https://www.w3schools.com/jsref/jsref_tostring_number.asp
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString

Plus you are not waiting for your page to get ready and load before the audioplayer ended function.
https://www.wix.com/corvid/reference/$w.html#onReady
https://www.wix.com/corvid/reference/$w.AudioPlayer.html#onEnded

If you do want this function to be performed when the page is loaded then you will need to write your code into the pages onReady function itself, which examples can be found for in the Wix API Reference links added below.

With getting the dataset field value, you can just use getCurrentItem to call that from your dataset.
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#getCurrentItem
$w(“#myDataset”).getCurrentItem(); - gets all the items data.
$w(‘#dynamicDataset’).getCurrentItem().item - gets just the appropriate field

Also, if you want to resave the new total then you should be using setFieldValue function with the save function afterwards.
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#setFieldValue

You might have to refresh your page for it to show any updated dataset settings, so you can try doing something like this after your save…

$w("#myDataset").save()
.then( (item) => {
  wixLocation.to("/yourpageURL");
 } )
 .catch( (err) => { let errMsg = err; 
 } );

You might want to vote for this feature too.