User guide

Relevant Chapters: Working with Categories (page 18).
Notifications Support Interruption Handling
An audio interruption is the deactivation of your apps audio session—which immediately stops your audio.
Interruptions occur when a competing audio session from an app activates and that session is not categorized
by the system to mix with yours. After your session goes inactive, the system sends a “you were interrupted”
message which you can respond to by saving state, updating the user interface, and so on.
To handle interruptions, register for AVAudioSessionInterruptionNotification provided in
AVAudioSession. Write your beginInterruption and endInterruption methods to ensure the minimum
possible disruption, and the most graceful possible recovery, from the perspective of the user.
Relevant Chapters: Responding to Interruptions (page 26).
Notifications Support Audio Route Change Handling
Users have particular expectations when they initiate an audio route change by docking or undocking a device,
or by plugging in or unplugging a headset. Sound in iOS Human Interface Guidelines describes these expectations
and provides guidelines on how to meet them. Handle route changes by registering for
AVAudioSessionRouteChangeNotification.
Relevant Chapters: Responding to Route Changes (page 37).
Categories Support Advanced Features
You can fine-tune an audio session category in a variety of ways. Depending on the category, you can:
Allow other audio (such as from the Music app) to mix with yours when a category normally disallows it.
Change the audio output route from the receiver to the speaker.
Allow Bluetooth audio input.
Specify that other audio should reduce in volume (“duck”) when your audio plays.
Optimize your app for device hardware at runtime. Your code adapts to the device it’s running on and to
changes initiated by the user (such as by plugging in a headset) as your app runs.
Introduction
At a Glance
2014-09-17 | Copyright © 2014 Apple Inc. All Rights Reserved.
8