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