User guide
Table 3-2 summarizes how to handle audio interruptions according to technology. The rest of this chapter
provides details.
Table 3-2 Audio interruption handling techniques according to audio technology
How interruptions workAudio technology
The AVAudioPlayer and AVAudioRecorder classes provide delegate
methods for interruption start and end. Implement these methods to
update your user interface and optionally, after interruption ends, to
resume paused playback. The system automatically pauses playback or
recording upon interruption and reactivates your audio session when
you resume playback or recording.
If you want to save and restore the playback position between app
launches, save the playback position on interruption as well as on app
quit.
AV Foundation framework
These technologies put your app in control of handling interruptions.
You are responsible for saving playback or recording position and for
reactivating your audio session after interruption ends.
Audio Queue Services, I/O
audio unit
When using OpenAL for playback, register for the appropriate
NSNotification notifications—as when using Audio Queue Services.
However, the delegate must additionally manage the OpenAL context.
See OpenAL and Audio Interruptions (page 29).
OpenAL
Sounds played using System Sound Services go silent when an
interruption starts. They can automatically be used again if the
interruption ends. Apps cannot influence the interruption behavior for
sounds that use this playback technology.
System Sound Services
Handling Interruptions From Siri
When your app is interrupted during playback by Siri, you must keep track of any remote control commands
issued by Siri while the audio session is interrupted. During the interrupted state, keep track of any commands
issued by Siri and respond accordingly when the interruption ends. For example, during the interruption, the
user asks Siri to pause your app’s audio playback. When your app is notified that the interruption has ended,
it should not automatically resume playing. Instead, your app’s UI should indicate that it is in a paused state.
Responding to Interruptions
Audio Interruption Handling Techniques
2014-09-17 | Copyright © 2014 Apple Inc. All Rights Reserved.
27