iOS Reference Library Apple Developer
Search

Audio Session Categories

You tell iOS your application’s audio intentions by designating a category for your audio session. Table A-1 provides details on each of the categories. The default category, kAudioSessionCategory_SoloAmbientSound, is shaded. For an explanation of how categories work, see “Choosing the Best Category.” For an explanation of the mixing override switch, see “Fine-Tuning the Category.”

Table A-1  Audio session category behavior

Category identifiers*

Silenced by the Ring/Silent switch and by screen locking

Allows audio from other applications

Allows audio input (recording) and output (playback)

AVAudioSessionCategoryAmbient

kAudioSessionCategory_AmbientSound

Yes

Yes

Output only

AVAudioSessionCategorySoloAmbient

kAudioSessionCategory_SoloAmbientSound

Yes

No

Output only

AVAudioSessionCategoryPlayback

kAudioSessionCategory_MediaPlayback

No

No by default; yes by using override switch

Output only

AVAudioSessionCategoryRecord

kAudioSessionCategory_RecordAudio

No (recording continues with the screen locked)

No

Input only

AVAudioSessionCategoryPlayAndRecord

kAudioSessionCategory_PlayAndRecord

No

No by default; yes by using override switch

Input and output

AVAudioSessionCategoryAudioProcessing

kAudioSessionCategory_AudioProcessing

–

No

No input and no output

*In each row, the first identifier is for the Objective-C-based AVAudioSession interface; the second identifier is for the C-based Audio Session Services interface.

Notes: Versions of iOS earlier than iOS 2.2 did not include the kAudioSessionCategory_SoloAmbientSound category and instead used the kAudioSessionCategory_MediaPlayback category as the default. Two deprecated categories are not shown in the table: The deprecated kAudioSessionCategory_UserInterfaceSoundEffects category is equivalent to AVAudioSessionCategoryAmbient; the deprecated kAudioSessionCategory_LiveAudio category is equivalent to AVAudioSessionCategoryPlayback.




Last updated: 2010-07-09

Did this document help you? Yes It's good, but... Not helpful...