My app has a section for playing audio:
chnl = new SoundChannel(); mp3 = new Sound(); mp3.addEventListener(IOErrorEvent.IO_ERROR, onErr); mp3.addEventListener(Event.COMPLETE, onComplete); mp3.load(new URLRequest(fil.url));
While the sound is playing if the phone rings (or an alarm is activated), then the application stops playing, that is normal. But when I try to re-play the audio, it does not work anymore unless I close and re-open the app.
This does not happen if I minimize the app and re-launch it, or the phone rings on Android. It just happens on iPhone.
As a workaround, when I add this line:
SoundMixer.audioPlaybackMode = AudioPlaybackMode.VOICE;
The problem will solve! However, the audio will then only play through the earpiece, and not the Speaker. Even if I set:
SoundMixer.useSpeakerphoneForVoice = true;
Any ideas, please??