AVAudioSession - General recommendations for handling AVAudioSessionMediaServicesWereResetNotification
Should my application register for
AVAudioSessionMediaServicesWereResetNotification and if so, how do I recover once media services were reset?
A: While this is a very rare occurrence, it is good practice to monitor for the
AVAudioSessionMediaServicesWereResetNotification notification and if it does occur, take the appropriate steps to re-initialize any audio objects used by your application.
Re-initializing generally requires disposing all of an application's now orphaned audio objects (for example
AudioConverter and so on since none of them will function as expected), and re-creating them as if the application was starting up for the first time. Any errors returned during disposing can safely be ignored.
General recommendations for handling a media services reset (
Register a notification listener for
Upon receiving the
AVAudioSessionMediaServicesWereResetNotification notification, applications should:
Dispose orphaned audio objects and create new audio objects
Reset any internal audio state being tracked, including all properties of
When appropriate, reactivate the
Document Revision History
Adding note regarding how to test resetting the media server.
Updated for AVAudioSession
New document that discusses some steps audio applications may take to recover if media services were reset.