I've been developing a little game for a while now and the last big problem to tackle at the moment is that after starting the game back from idle or shutting the screen off for a little while on many iOS devices, the audio will not play at all. No errors are thrown and all the traces I've built in seem to thing everything is all hunky-dory, but there is no sound. Sometimes after waiting 5-30 seconds the sound will start working again, but I have no idea why. The method I'm using for sound is just reading the sounds is this:
var request:URLRequest = new URLRequest(Paths.AUDIO_PATH + "soundfile.mp3"); var _sound:Sound = new Sound(); _sound.addEventListener(IOErrorEvent.IO_ERROR, dontPlay); if (after != null) _sound.addEventListener(Event.SOUND_COMPLETE, after); _sound.load(request); trace(Paths.AUDIO_PATH + sound); var channel:SoundChannel = _sound.play(start);
has anyone else experienced this? Am I doing something essentially wrong?