Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <button id="m1" min="0.1" max="1.5" value="1.0" onclick="a.playbackRate=m1.value++;">Slow It DOwn!!</button>
- <button id="m2" min="0.1" max="1.5" value="1.0" onclick="a.playbackRate=m2.value--;">Slow It DOwn!!</button>
- <audio type="audio/mpeg" id="aud" src="http://compulsivecoding.com/DJ%20BrU%20-%20The%20Influx.mp3" autoplay="false"><audio/>
- <script>
- var audioCtx = new AudioContext();
- var oscillator=audioCtx.createGainNode();
- oscillator.connect(audiotCtx.destination);
- audioCtx.connect(oscillator.gain)
- aud.play(aud);
- </script>
- <script>
- var a = document.getElementById("aud");
- function getPlaySpeed() {
- alert(a.playbackRate);
- }
- document.onclick=function setPlaySpeed(value) {
- a.playbackRate = value;
- }
- setPlaySpeed(0.5);
- oscillator.gain.value='0.3';
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment