iOS 5 Audio Alarms Don't Sound Without kAudioSessionProperty_OverrideCategoryMixWithOthers On

Posted by coneybeare on Stack Overflow See other posts from Stack Overflow or by coneybeare
Published on 2011-11-20T15:38:12Z Indexed on 2011/11/20 17:50 UTC
Read the original article Hit count: 387

Filed under:
|
|
|
|

I have an audio app that is having some problems with the way iOS 5 has changed audio behaviors. When my app's audio is playing (AVAudioSessionCategoryPlayback), and a Clock.app alarm or timer is fired from the OS, the UIAlertView notification pops up, but without the audio alert. My application sound ducks fine to get out of the way of the audio alert, but the alarm app's audio alert does not sound.

Naturally, tons of support requests poured in over the iOS 5 change. I have solved this temporarily by setting kAudioSessionProperty_OverrideCategoryMixWithOthers which lets the alarm audio come through, but there are a few very undesirable side-effects when doing this:

  • Other app's audio can play with/over mine.
  • The remote control events are not routed to my app, but to iPod.app.

None of the above drawbacks are acceptable for my app's requirements. I have been hacking away at this for some time now but haven't been able to crack it. How can I setup my audio such that:

  1. My app's audio still uses the AVAudioSessionCategoryPlayback category for background audio.
  2. The Clock.app alarms still have their audio alerts make sound
  3. The app still responds to remote control notifications

© Stack Overflow or respective owner

Related posts about iphone

Related posts about ios