Javascript examples for DOM HTML Element:Audio
Audio defaultPlaybackRate Property - Set the audio to play faster by default:
<!DOCTYPE html> <html> <body> <audio id="myAudio" controls> <source src="your.ogg" type="audio/ogg"> <source src="your.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio><br> <button onclick="getPlaySpeed()" type="button">What is the default playback speed?</button> <button onclick="setPlaySpeed()" type="button">Set video to be play fast</button> <script> var x = document.getElementById("myAudio"); function getPlaySpeed() {/* w ww . j a v a2 s. c om*/ console.log(x.defaultPlaybackRate); } function setPlaySpeed() { x.defaultPlaybackRate = 2; x.load(); } </script> </body> </html>