I've run into some inconsistent behaviour between browsers with SoundJS, namely that IE11 is stingy about playing from Abstract Sound Instances.
The following code works in every other browser I've tested, but not in IE11:
<html>
<head>
<script src="https://code.createjs.com/soundjs-0.6.1.min.js"></script>
<script>
var sounds = {}
function loadSounds() {
createjs.Sound.registerSound('audio/song.mp3', 'song', 1);
songInst = createjs.Sound.createInstance('song');
sounds['song'] = songInst;
}
function startSound(id,v,l){
sounds[id].play({loop:((l===true)?-1:0),volume:v});
}
</script>
</head>
<body onload="loadSounds()">
<button value="StartSound" onclick="startSound('song',1,true)">startSound</button>
</body>
</html>
I AM able to get the sound to play in IE11 by changing the startSound() function to this:
function startSound(id,v,l){
createjs.Sound.play(id,{loop:((l===true)?-1:0),volume:v});
}
But this creates problems for the rest of my implementation, since each sound will need a uniquely-identifiable instance that I can call back to for features like volume tweening.
Is there anything I'm missing that would allow the first approach to work?