How to stop/play a sound loop?
Hello, I managed to make the sound loop start when the frame loads using this code:
createjs.Sound.on("fileload", handleLoad);
createjs.Sound.alternateExtensions = ["m4a"];
createjs.Sound.registerSound({
id: "audioLoop",
src: "sounds/myAudioLoop.ogg"
});
function handleLoad(event) {
var audioLoopInstance = createjs.Sound.play("audioLoop", {
interrupt: createjs.Sound.INTERRUPT_ANY,
loop: -1
});
};When I try audioLoopInstance.stop(); or audioLoopInstance.play(); though, nothing seem to happen.
The stop all sounds seem to work, although I don't know how to play it again after that:
stopEverySounds = function () {
return createjs.Sound.stop();
}
stopEverySounds();
I am trying to learn to use the sound instance thing. How do I make audioLoopInstance to start the sound again?
