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