Closed raphaelbastide closed 9 years ago
createWave/createWaves creates Audio objects. You can see the full spec at http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#the-audio-element . To stop the sound you can just use sound.pause()
. Also here's a tip; to see what things an element supports you can use: for(var e in (new Audio())) console.log(e)
.
It is exactly what I was looking for. Thank you for that.
I am sorry, I still get an issue because I don't really understand how to stop or pause the current sound. Should I make a button with sound.pause()
? And Should I create a this.pause
function in jsfxguy.js?
Pause method is available on all Audio objects. So just call pause on the currently playing wave.
var wave = audio.make(data);
wave.play();
...
wave.pause();
I was wondering if there is a way to stop (interrupt) a sound.