get duration of audio file javascript code example Example: js audio get duration let x = document.getElementById("myAudio").duration;