User guide
If you think of an iOS device as an airport, with apps represented as taxiing planes, the system serves as a sort
of control tower. Your app can make audio requests and state its desired priority, but final authority over what
happens “on the tarmac” comes from the system. You communicate with the “control tower” using the audio
session. Figure 1-1 illustrates a typical scenario—your app wanting to use audio while the Music app is already
playing. In this scenario your app interrupts the Music app.
Figure 1-1 The system manages competing audio demands
In step 1 of the figure, your app requests activation of its audio session. You’d make such a request, for example,
on app launch, or perhaps in response to a user tapping the Play button in an audio recording and playback
app. In step 2, the system considers the activation request. Specifically, it considers the category you’ve assigned
to your audio session. In Figure 1-1, the SpeakHere app uses a category that requires other audio to be silenced.
In steps 3 and 4, the system deactivates the Music app’s audio session, stopping its audio playback. Finally, in
step 5, the system activates the SpeakHere app’s audio session and playback can begin.
Defining an Audio Session
How the System Resolves Competing Audio Demands
2014-09-17 | Copyright © 2014 Apple Inc. All Rights Reserved.
13