User guide

At a Glance
AVAudioSession gives you control your app’s audio behavior. You can:
Select the appropriate input and output routes for your app
Determine how your app integrates audio from other apps
Handle interruptions from other apps
Automatically configure audio for the type of app your are creating
An Audio Session Encapsulates a Set of Behaviors
An audio session is the intermediary between your app and iOS used to configure your apps audio behavior.
Upon launch, your app automatically gets a singleton audio session.
Relevant Chapters: Defining an Audio Session (page 10).
Categories Express Audio Roles
The primary mechanism for expressing audio behaviors is the audio session category. By setting the category,
you indicate whether your app uses input or output routes, whether you want music to continue playing along
with your audio, and so on. The behavior you specify should meet user expectations as described in Sound in
iOS Human Interface Guidelines .
Seven audio session categories, along with a set of override and modifier switches, let you customize audio
behavior according to your apps personality or role. Various categories support playback, recording, and
playback along with recording. When the system knows your apps audio role, it affords you appropriate access
to hardware resources. The system also ensures that other audio on the device behaves in a way that works
for your app; for example, if you need the Music app to be interrupted, it is.
Relevant Chapters: Working with Categories (page 18) and Responding to Interruptions (page
26).
Modes Customize Categories
Users expect certain behaviors from certain categories of apps. Modes specialize the behavior of a given
category. For example, when an app uses the Video Recording mode, the system may choose a different built-in
microphone than it would if it was using the default mode. The system may also engage microphone signal
processing that is tuned for video recording use cases.
Introduction
At a Glance
2014-09-17 | Copyright © 2014 Apple Inc. All Rights Reserved.
7