How to get the length of time that audio has been loaded (non-playback time)

how do I use JavaScript to get the length of data that the audio element has loaded?

<audio  id="audio" src="./static/audio/audio1.mp3" preload="none"></audio>
<div class="play_control">
     <img class="play_btn" src="./static/img/stop.png" alt="play">
     <span id="time">00:00</span>
     <span id="duration">/00:00</span>
     <div class="process">
          <span id="loaded"></span>
          <span id="playing_time"></span>
     </div>
 </div>
 

loaded progress bar is used as data loading progress bar and playing_time as playback progress bar, but I don"t know how to get the length of data loaded from the background, and it is incorrect to use the buffered property in using progress events.

Apr.10,2021

if the progress time of audio is not accurate, I think we can write a middleware responsible for loading, which is responsible for counting the current loading progress, and then feed it to audio with ObjectURL

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b907-2c2b9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b907-2c2b9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?