<html>
<body>
<audio controls ondurationchange="myFunction()">
<source src="/i/horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<script>
function myFunction() {
alert("The audio duration has changed");
}
</script>
</body>
</html>