How do I play a sound using SoundJS in HTML Canvas?
I've tried a million things and can't get this sound to play either from the "test" menu item or from a local server.
I have previewed the sound in Animate and it plays, it's a 128kb MP3, and I've tried on Mac Safari, Chrome, and Firefox. Still, I get no sound.
I'm sure it's something simple... first time trying to do this... help is much appreciated!
My Code:
createjs.Sound.on("fileload", handleLoad);
createjs.Sound.registerSound("sounds/discoSong.mp3", "myID", 3);
function handleLoad(event) {
createjs.Sound.play("myID");
var myInstance = createjs.Sound.play("myID");
console.log(myInstance);
}
The output from that console.log:
a {_listeners: null, _captureListeners: null, src: "sounds/discoSong.mp3", uniqueId: 1, playState: "playSucceeded", …}
"playSucceeded"... I think not!
Thanks!
