Audio Session Categories and Modes

You specify an audio session category to express how you intend to use audio in your app. Table B-1 provides details about each of the available categories. For an explanation of how categories work, see Configuring an Audio Session.

Table B-1  Audio Session category behavior

Category

Silenced by the Ring/Silent switch and by screen locking see note

Interrupts nonmixable app’s audio

Allows audio input (recording) and output (playback)

AVAudioSessionCategoryAmbient

Yes

No

Output only

AVAudioSessionCategorySoloAmbient (Default)

Yes

Yes

Output only

AVAudioSessionCategoryPlayback

No

Yes by default; no by using override switch

Output only

AVAudioSessionCategoryRecord

No (recording continues with screen locked)

Yes

Input only

AVAudioSessionCategoryPlayAndRecord

No

Yes by default; no by using override switch

Input and output

AVAudioSessionCategoryMultiRoute

No

Yes

Input and output

Table B-2 provides a list of modes and the categories each mode can be used with.

Table B-2  Modes and associated categories

Mode identifiers

Compatible categories

AVAudioSessionModeDefault

All

AVAudioSessionModeMoviePlayback

AVAudioSessionCategoryPlayback

AVAudioSessionModeVideoRecording

AVAudioSessionCategoryPlayAndRecord

AVAudioSessionCategoryRecord

AVAudioSessionModeVoiceChat

AVAudioSessionCategoryPlayAndRecord

AVAudioSessionModeGameChat

AVAudioSessionCategoryPlayAndRecord

AVAudioSessionModeVideoChat

AVAudioSessionCategoryPlayAndRecord

AVAudioSessionModeMeasurement

AVAudioSessionCategoryPlayAndRecord

AVAudioSessionCategoryRecord

AVAudioSessionCategoryPlayback