Audio Session Categories and Modes

You tell iOS your app’s audio intentions by designating a category for your audio session. Table B-1 provides details on each of the categories. The default category, AVAudioSessionCategorySoloAmbient, is shaded. For an explanation of how categories work, see Working with Categories. For an explanation of the mixing override switch, see Choosing the Best Category.

Table B-1  Audio session category behavior

Category identifiers

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

Interrupts non-mixable apps audio

Allows audio input (recording) and output (playback)

AVAudioSessionCategoryAmbient

Yes

No

Output only

AVAudioSessionCategoryAudioProcessing

Yes

No input and no output

AVAudioSessionCategoryMultiRoute

No

Yes

Input and output

AVAudioSessionCategoryPlayAndRecord

No

Yes by default; no by using override switch

Input and output

AVAudioSessionCategoryPlayback

No

Yes by default; no by using override switch

Output only

AVAudioSessionCategoryRecord

No (recording continues with the screen locked)

Yes

Input only

AVAudioSessionCategorySoloAmbient

Yes

Yes

Output only

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

Table B-2  Modes and associated categories

Mode identifiers

Compatible categories

AVAudioSessionModeDefault

All

AVAudioSessionModeVoiceChat

AVAudioSessionCategoryPlayAndRecord

AVAudioSessionModeGameChat

AVAudioSessionCategoryPlayAndRecord

AVAudioSessionModeVideoRecording

AVAudioSessionCategoryPlayAndRecord

AVAudioSessionCategoryRecord

AVAudioSessionModeMoviePlayback

AVAudioSessionCategoryPlayback

AVAudioSessionModeMeasurement

AVAudioSessionCategoryPlayAndRecord

AVAudioSessionCategoryRecord

AVAudioSessionCategoryPlayback

AVAudioSessionModeVideoChat

AVAudioSessionCategoryPlayAndRecord