Control the audio speed of an mp3 file

advertisements

I would like to play a mp3 soundtrack on my website, and manipulate the speed of the soundtrack by a percentage using a slider. I'm wondering how this could be done with only HTML(5) and JavaScript. I haven't been able to find any examples or tutorials, any help would be greatly appreciated.


Something like this:

myaudio=document.getElementById("audio1");
myaudio.playbackRate=0.5;

This is the basics to demonstrate that audio and videos both have property you can set to change the playing rate. The implementation of sliders and other things, you can achieve using jquery based on how you want it.