| Framework | AudioToolbox/AudioToolbox.h |
| Declared in | AudioServices.h |
This document describes Audio Session Services, a C interface for managing an application’s audio behavior in the context of other applications.
Audio Session Services lets you specify the intended audio behavior for your iPhone OS application. For example, you can specify whether you intend for your application’s audio to silence built-in applications or to mix with their audio. You also use Audio Session Services to specify your application’s behavior when it is interrupted, such as by a phone call.
These functions apply only to iPhone OS. They do not apply to Mac OS X.
AudioSessionGetProperty
AudioSessionSetProperty
AudioSessionGetPropertySize
AudioSessionAddPropertyListener
AudioSessionRemovePropertyListenerWithUserData
AudioSessionRemovePropertyListener
Adds a property listener callback function to your application’s audio session object.
OSStatus AudioSessionAddPropertyListener ( AudioSessionPropertyID inID, AudioSessionPropertyListener inProc, void *inClientData );
The identifier for the audio session property whose value changes you want to listen for.
The name of your property listener callback function.
Data that you would like to be passed to your property listener callback.
A result code. See “Result Codes.”
When an audio session property value changes, and you have added a listener callback for that property, the audio session object invokes the callback.
You can add exactly one listener callback for a given inID-inClientData pair. In other words, you can add more than one property listener callback function for a given audio session property, provided you pass a unique inClientData parameter value each time you add a property listener.
Audio session properties are listed and described in “Audio Session Services Property Identifiers.”
AudioServices.hGets the value of a specified audio session property.
OSStatus AudioSessionGetProperty ( AudioSessionPropertyID inID, UInt32 *ioDataSize, void *outData );
The identifier for the audio session property that you want to get the value of.
On input, the memory size for the outData parameter. On output, the actual size of the property value.
On output, the value of the specified audio session property.
A result code. See “Result Codes.”
Audio session properties are listed and described in “Audio Session Services Property Identifiers.”
AudioServices.hGets the size of the value for a specified audio session property.
OSStatus AudioSessionGetPropertySize ( AudioSessionPropertyID inID, UInt32 *outDataSize );
The identifier for the audio session property whose value you want to get the size of.
On output, the size of the property value.
A result code. See “Result Codes.”
Audio session properties are listed and described in “Audio Session Services Property Identifiers.”
AudioServices.hInitializes an iPhone OS application’s audio session object.
OSStatus AudioSessionInitialize ( CFRunLoopRef inRunLoop, CFStringRef inRunLoopMode, AudioSessionInterruptionListener inInterruptionListener, void *inClientData );
The run loop that the interruption listener callback should be run on. Pass NULL to use the main run loop.
The mode for the run loop that the interruption listener function will run on. Passing NULL is equivalent to passing kCFRunLoopDefaultMode.
The interruption listener callback function. The application’s audio session object invokes the callback when the session is interrupted and (if the application is still running) when the interruption ends. Can be NULL. See AudioSessionInterruptionListener.
Data that you would like to be passed to your interruption listener callback.
A result code. See “Result Codes.”
Your application must call this function before making any other Audio Session Services calls. You may activate and deactivate your audio session as needed (see AudioSessionSetActive), but should initialize it only once.
AudioServices.hRemoves an audio session property listener callback function. (Deprecated. Use AudioSessionRemovePropertyListenerWithUserData instead.)
OSStatus AudioSessionRemovePropertyListener ( AudioSessionPropertyID inID );
The identifier for the audio session property whose value changes you no longer want to listen for.
A result code. See “Result Codes.”
AudioServices.hRemoves a property listener callback function from your application’s audio session object.
OSStatus AudioSessionRemovePropertyListenerWithUserData ( AudioSessionPropertyID inID, AudioSessionPropertyListener inProc, void *inClientData );
The identifier for the audio session property whose value changes you no longer want to listen for.
The name of your property listener callback function.
The same custom data for the property listener callback that you passed when calling the AudioSessionAddPropertyListener function.
A result code. See “Result Codes.”
Audio session properties are listed and described in “Audio Session Services Property Identifiers.”
AudioServices.hActives or deactivates an audio session object.
OSStatus AudioSessionSetActive ( Boolean active );
Pass true to activate your application’s audio session, or false to deactivate it.
A result code. See “Result Codes.”
Activating your audio session may interrupt audio sessions belonging to built-in applications running in the background, depending on categories and priorities. Deactivating your audio session allows other, interrupted audio sessions to resume.
When another active audio session does not allow mixing, attempting to activate your audio session may fail.
AudioServices.hSets the value of a specified audio session property.
OSStatus AudioSessionSetProperty ( AudioSessionPropertyID inID, UInt32 inDataSize, const void *inData );
The identifier for the audio session property that you want to set the value of.
The size, in bytes, of the value in the inData parameter.
The value that you are applying to the specified audio session property.
A result code. See “Result Codes.”
Audio session properties are listed and described in “Audio Session Services Property Identifiers.”
AudioServices.hInvoked when an audio interruption in iPhone OS begins or ends.
typedef void (*AudioSessionInterruptionListener)( void *inClientData, UInt32 inInterruptionState );
If you named your function MyInterruptionListener, you would declare it like this:
void MyInterruptionListener ( void *inClientData, UInt32 inInterruptionState );
Data that you specified in the inClientData parameter of the AudioSessionInitialize function. Can be NULL.
A constant that indicates whether the interruption has just started or just ended. See “Audio Session Services Interruption States.”
To register your interruption listener callback with your application’s audio session object, specify it in the AudioSessionInitialize function.
AudioServices.hInvoked when an audio session property changes in iPhone OS.
typedef void (*AudioSessionPropertyListener)( void *inClientData, AudioSessionPropertyID inID, UInt32 inDataSize, const void *inData );
If you named your function MyPropertyListener, you would declare it like this:
void MyPropertyListener ( void *inClientData, AudioSessionPropertyID inID, UInt32 inDataSize, const void *inData );
Data that you specified in the inClientData parameter of the AudioSessionAddPropertyListener function. Can be NULL.
The identifier for the audio session property whose value just changed. See “Audio Session Services Property Identifiers.”
The size, in bytes, of the value of the changed property.
The new value of the changed property.
You can register one or more property listener callbacks with your application’s audio session object by calling the AudioSessionAddPropertyListener function.
AudioServices.hThe data type for an audio session property identifier.
typedef UInt32 AudioSessionPropertyID;
Each Audio Session Services property has a four-character identifier. The properties are listed in “Audio Session Services Property Identifiers.”
AudioServices.hProperty identifiers used with Audio Session Services in iPhone OS.
enum {
kAudioSessionProperty_PreferredHardwareSampleRate = 'hwsr',
// read/write
kAudioSessionProperty_PreferredHardwareIOBufferDuration = 'iobd',
// read/write
kAudioSessionProperty_AudioCategory = 'acat',
// read/write
kAudioSessionProperty_AudioRoute = 'rout',
// read-only
kAudioSessionProperty_AudioRouteChange = 'roch',
// callback function
kAudioSessionProperty_CurrentHardwareSampleRate = 'chsr',
// read-only
kAudioSessionProperty_CurrentHardwareInputNumberChannels = 'chic',
// read-only
kAudioSessionProperty_CurrentHardwareOutputNumberChannels = 'choc',
// read-only
kAudioSessionProperty_CurrentHardwareOutputVolume = 'chov',
// read-only + callback function
kAudioSessionProperty_CurrentHardwareInputLatency = 'cilt',
// read-only
kAudioSessionProperty_CurrentHardwareOutputLatency = 'colt',
// read-only
kAudioSessionProperty_CurrentHardwareIOBufferDuration = 'chbd',
// read-only
kAudioSessionProperty_OtherAudioIsPlaying = 'othr',
// read-only
kAudioSessionProperty_OverrideAudioRoute = 'ovrd',
// write-only
kAudioSessionProperty_AudioInputAvailable = 'aiav',
// read-only + callback function
kAudioSessionProperty_ServerDied = 'died',
// callback function
kAudioSessionProperty_OtherMixableAudioShouldDuck = 'duck',
// read/write
kAudioSessionProperty_OverrideCategoryMixWithOthers = 'cmix',
// read/write
kAudioSessionProperty_OverrideCategoryDefaultToSpeaker = 'cspk',
// read/write
kAudioSessionProperty_OverrideCategoryEnableBluetoothInput = 'cblu'
// read/write
};
kAudioSessionProperty_PreferredHardwareSampleRateYour preferred hardware sample rate for the audio session. A read/write Float64 value. The actual sample rate may be different and can be obtained using the kAudioSessionProperty_CurrentHardwareSampleRate property.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionProperty_PreferredHardwareIOBufferDurationYour preferred hardware IO buffer duration in seconds. A read/write Float32 value. The actual IO buffer duration may be different.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionProperty_AudioCategoryThe category for the audio session. A read/write UInt32 value. See “Audio Session Categories.”
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionProperty_AudioRouteThe name of the current audio route (such as “Headphone,” “Speaker,” and so on). A read-only CFStringRef value.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionProperty_AudioRouteChangeA CFDictionaryRef object containing the reason the audio route changed and the name of the old route.
This object is available to your application only by way of a property listener callback function. See AudioSessionAddPropertyListener. The CFDictionary object contains two keys and values. The kAudioSession_AudioRouteChangeKey_Reason key has a CFNumberRef value that identifies the reason for the route change. See “Audio Session Route Change Reasons.” The kAudioSession_AudioRouteChangeKey_OldRoute key has a CFStringRef value that names the old audio route.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionProperty_CurrentHardwareSampleRateIndicates the current hardware sample rate. A read-only Float64 value.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionProperty_CurrentHardwareInputNumberChannelsIndicates the current number of audio hardware input channels. A read-only UInt32 value.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionProperty_CurrentHardwareOutputNumberChannelsIndicates the current number of audio hardware output channels. A read-only UInt32 value.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionProperty_CurrentHardwareOutputVolumeIndicates the current audio output volume as Float32 value between 0.0 and 1.0. Read-only. This value is available to your application by way of a property listener callback function. See AudioSessionAddPropertyListener.
Available in iPhone OS 2.1 and later.
Declared in AudioServices.h.
kAudioSessionProperty_CurrentHardwareInputLatencyIndicates the current hardware input latency, in seconds, as a read-only Float32 value.
Available in iPhone OS 2.1 and later.
Declared in AudioServices.h.
kAudioSessionProperty_CurrentHardwareOutputLatencyIndicates the current hardware output latency, in seconds, as a read-only Float32 value.
Available in iPhone OS 2.1 and later.
Declared in AudioServices.h.
kAudioSessionProperty_CurrentHardwareIOBufferDurationIndicates the current hardware IO buffer duration, in seconds, as a read-only Float32 value.
Available in iPhone OS 2.1 and later.
Declared in AudioServices.h.
kAudioSessionProperty_OtherAudioIsPlayingIndicates whether or not another application (typically, the iPod application) is currently playing audio. Read-only. A non-zero UInt32 value indicates that other audio is playing.
Available in iPhone OS 2.1 and later.
Declared in AudioServices.h.
kAudioSessionProperty_OverrideAudioRouteSpecifies whether or not to override the audio session category’s normal audio route. Can be set with one of two values: kAudioSessionOverrideAudioRoute_None, which specifies that you want to use the normal audio route; and kAudioSessionOverrideAudioRoute_Speaker, when sends output audio to the speaker. A write-only UInt32 value.
Upon an audio route change (such as by plugging in or unplugging a headset), or upon interruption, this property reverts to its default value. This property can be used only with the kAudioSessionCategory_PlayAndRecord (or the equivalent AVAudioSessionCategoryRecord) category.
See also kAudioSessionProperty_OverrideCategoryDefaultToSpeaker.
Available in iPhone OS 2.1 and later.
Declared in AudioServices.h.
kAudioSessionProperty_AudioInputAvailableIndicates if audio input is available (a nonzero value) or not (a value of 0). A read-only UInt32 value, interpreted as a Boolean value. Use this property, rather than the device model, to determine if audio input is available.
You can listen for changes in the value of this property using a callback function. For instance, if a user plugs a headset into an iPod touch (2nd generation), audio input becomes available via the wired microphone and your callback is invoked. See AudioSessionAddPropertyListener.
Available in iPhone OS 2.2 and later.
Declared in AudioServices.h.
kAudioSessionProperty_ServerDiedIndicates if the audio server has died (indicated by a nonzero UInt32 value) or is still running (a value of 0).
This value is available to your application only by way of a property listener callback function. See AudioSessionAddPropertyListener.
Available in iPhone OS 3.0 and later.
Declared in AudioServices.h.
kAudioSessionProperty_OtherMixableAudioShouldDuckFor audio session categories that allow mixing of iPod audio with application audio, specifies whether iPod audio should be reduced in level when your application produces sound. This property has a value of FALSE (0) by default. Set it to a nonzero value to turn on ducking.
Available in iPhone OS 3.0 and later.
Declared in AudioServices.h.
kAudioSessionProperty_OverrideCategoryMixWithOthersChanges the mixing behavior of the kAudioSessionCategory_MediaPlayback and kAudioSessionCategory_PlayAndRecord audio session categories. Setting this property to TRUE (any nonzero value) allows mixing of iPod audio with application audio. Other aspects of these categories, such as their Ring/Silent switch behavior, are not affected.
This property has value of FALSE (0) by default. When the audio session category changes, such as during an interruption, the value of this property reverts to FALSE. To regain mixing behavior you must then re-set this property.
Always check to see if setting this property succeeds or fails, and react appropriately; behavior may change in future releases of iPhone OS.
Available in iPhone OS 3.0 and later.
Declared in AudioServices.h.
kAudioSessionProperty_OverrideCategoryDefaultToSpeakerSpecifies whether or not to route audio to the speaker (instead of to the receiver) when no other audio route, such as a headset, is connected. By default, the value of this property is FALSE (0). A read/write UInt32 value.
This property retains its value through an audio route change (such as when plugging in or unplugging a headset), and upon interruption; it reverts to its default value only upon an audio session category change. This property can be used only with the kAudioSessionCategory_PlayAndRecord (or the equivalent AVAudioSessionCategoryRecord) category.
See also kAudioSessionProperty_OverrideAudioRoute.
Available in iPhone OS 3.1 and later.
Declared in AudioServices.h.
kAudioSessionProperty_OverrideCategoryEnableBluetoothInputAllows a paired Bluetooth device to appear as an available audio input route. By default, the value of this property is FALSE (0). A read/write UInt32 value.
This property can be used to modify the kAudioSessionCategory_RecordAudio or kAudioSessionCategory_PlayAndRecord categories.
Use of this property doesn’t affect the audio output route for the kAudioSessionCategory_PlayAndRecord category. Attempting to set this property to TRUE will fail for all categories other than kAudioSessionCategory_RecordAudio and kAudioSessionCategory_PlayAndRecord.
Available in iPhone OS 3.1 and later.
Declared in AudioServices.h.
Use these property identifiers in concert with the AudioSessionGetProperty, AudioSessionSetProperty, and AudioSessionAddPropertyListener functions.
Category identifiers for audio sessions, used as values for the kAudioSessionProperty_AudioCategory property.
enum {
kAudioSessionCategory_UserInterfaceSoundEffects = 'uifx', // deprecated
kAudioSessionCategory_AmbientSound = 'ambi',
kAudioSessionCategory_SoloAmbientSound = 'solo',
kAudioSessionCategory_MediaPlayback = 'medi',
kAudioSessionCategory_LiveAudio = 'live', // deprecated
kAudioSessionCategory_RecordAudio = 'reca',
kAudioSessionCategory_PlayAndRecord = 'plar'
kAudioSessionCategory_AudioProcessing = 'proc'
};
kAudioSessionCategory_UserInterfaceSoundEffectsFor sound effects such as touch feedback, explosions, and so on.
Equivalent to the kAudioSessionCategory_AmbientSound category, which you should use instead. The kAudioSessionCategory_UserInterfaceSoundEffects category is deprecated in iPhone OS 3.0.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionCategory_AmbientSoundFor long-duration sounds such as rain, car engine noise, and so on. It is also for “play along” style applications, such a virtual piano that a user plays over iPod audio.
When you use this category, audio from built-in applications, such as the iPod, mixes with your audio. Your audio is silenced when the Ring/Silent switch is set to silent or when the screen locks.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionCategory_SoloAmbientSoundThe default category, used unless you set a category with the AudioSessionSetProperty function. The solo ambient sound category is for long-duration sounds such as rain, car engine noise, and so on.
When you use this category, audio from built-in applications, such as the iPod, is silenced. Your audio is silenced when the Ring/Silent switch is set to “silent” or when the screen locks.
Available in iPhone OS 2.2 and later.
Declared in AudioServices.h.
kAudioSessionCategory_MediaPlaybackFor playing recorded music or other sounds that are central to the successful use of your application.
When using this category, your application audio continues with the Ring/Silent switch set to silent or when the screen locks.
This category normally disallows iPod audio to mix with application audio. To allow mixing for this category, use the kAudioSessionProperty_OverrideCategoryMixWithOthers property.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionCategory_LiveAudioFor live performance of music, such as for an application that simulates a piano.
Equivalent to the kAudioSessionCategory_MediaPlayback category, which you should use instead. The kAudioSessionCategory_LiveAudio category is deprecated in iPhone OS 3.0.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionCategory_RecordAudioFor recording audio; it silences playback audio.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionCategory_PlayAndRecordAllows recording (input) and playback (output) of audio, such as for a VOIP (voice over IP) application.
This category is appropriate for simultaneous recording and playback, and also for applications that record and play back but not simultaneously. If you want to ensure that sounds such as Messages alerts do not play while your application is recording, use the kAudioSessionCategory_RecordAudio category instead.
This category normally disallows iPod audio to mix with application audio. To allow mixing for this category, use the kAudioSessionProperty_OverrideCategoryMixWithOthers property.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionCategory_AudioProcessingFor using an audio hardware codec or signal processor while not playing or recording audio.
Available in iPhone OS 3.1 and later.
Declared in AudioServices.h.
Each application running in iPhone OS has a single audio session, which can be active or inactive. You can change your audio session’s category while your program is running.
The kAudioSessionCategory_AmbientSound category implies the intention that you want your sounds to mix with other sounds on the system—notably, with iPod audio. The categories further down in the list imply the intention that you want all other sounds to be silenced when your session is active. However, you can modify this behavior for the kAudioSessionCategory_MediaPlayback and kAudioSessionCategory_PlayAndRecord categories by using the kAudioSessionProperty_OverrideCategoryMixWithOthers property.
For more information on audio session categories, see Audio Session Programming Guide.
Identifiers for the various reasons that an audio route can change while your iPhone OS application is running.
enum {
kAudioSessionRouteChangeReason_Unknown = 0,
kAudioSessionRouteChangeReason_NewDeviceAvailable = 1,
kAudioSessionRouteChangeReason_OldDeviceUnavailable = 2,
kAudioSessionRouteChangeReason_CategoryChange = 3,
kAudioSessionRouteChangeReason_Override = 4,
// this enum has no constant with a value of 5
kAudioSessionRouteChangeReason_WakeFromSleep = 6,
kAudioSessionRouteChangeReason_NoSuitableRouteForCategory = 7
};
kAudioSessionRouteChangeReason_UnknownThe audio route changed but the reason is not known.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionRouteChangeReason_NewDeviceAvailableA new audio hardware device became available; for example, a headset was plugged in.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionRouteChangeReason_OldDeviceUnavailableThe previously-used audio hardware device is now unavailable; for example, a headset was unplugged.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionRouteChangeReason_CategoryChangeThe audio session category has changed.
Available in iPhone OS 2.1 and later.
Declared in AudioServices.h.
kAudioSessionRouteChangeReason_OverrideThe audio route has been overridden. For example, while using the kAudioSessionCategory_PlayAndRecord category, output audio has been redirected to the speaker using the kAudioSessionProperty_OverrideAudioRoute property.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionRouteChangeReason_WakeFromSleepThe iPhone or iPod touch woke from sleep.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionRouteChangeReason_NoSuitableRouteForCategoryThere is no audio hardware route for the audio session category; for instance, the kAudioSessionCategory_RecordAudio is set but there is no audio input device.
Available in iPhone OS 3.1 and later.
Declared in AudioServices.h.
You encounter these identifiers as values in the CFDictionaryRef object passed to your property listener callback function when it is listening for audio route changes. See the description for kAudioSessionProperty_AudioRouteChange.
Specifies whether the default audio route for the PlayAndRecord category should be overridden.
enum {
kAudioSessionOverrideAudioRoute_None = 0,
kAudioSessionOverrideAudioRoute_Speaker = 'spkr'
};
kAudioSessionOverrideAudioRoute_NoneSpecifies, for the kAudioSessionCategory_PlayAndRecord category, that output audio should go to the receiver. This is the default output audio route for this category.
Available in iPhone OS 2.1 and later.
Declared in AudioServices.h.
kAudioSessionOverrideAudioRoute_SpeakerSpecifies, for the kAudioSessionCategory_PlayAndRecord category, that output audio should go to the speaker, not the receiver.
Available in iPhone OS 2.1 and later.
Declared in AudioServices.h.
The kAudioSessionCategory_PlayAndRecord category supports simultaneous input and output. You could use this category, for example, to add an effect to audio coming into the iPhone’s microphone. By default, output audio for this category goes to the receiver—the speaker you hold to your ear when on a phone call. The kAudioSessionOverrideAudioRoute_Speaker constant lets you direct the output audio to the speaker situated at the bottom of the phone.
Identifiers used with the AudioSessionInterruptionListener callback function in iPhone OS to indicate that an audio interruption has started or stopped.
enum {
kAudioSessionBeginInterruption = 1,
kAudioSessionEndInterruption = 0
};
kAudioSessionBeginInterruptionYour application’s audio session has just been interrupted, such as by a phone call.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSessionEndInterruptionThe interruption to your application’s audio session has just ended. In the case where a user confirms the interruption, such as answering a phone call, your application will not receive this constant.
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
Keys for obtaining information about an audio hardware route change.
#define kAudioSession_AudioRouteChangeKey_Reason "OutputDeviceDidChange_Reason" #define kAudioSession_AudioRouteChangeKey_OldRoute "OutputDeviceDidChange_OldRoute"
kAudioSession_AudioRouteChangeKey_ReasonThe value for this key is a CFNumberRef object that identifies one of the reasons listed in “Audio Session Route Change Reasons.”
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
kAudioSession_AudioRouteChangeKey_OldRouteThe value for this key is a CFStringRef object that names the previous audio hardware route (such as “Headphone” or “Speaker”).
Available in iPhone OS 2.0 and later.
Declared in AudioServices.h.
Use these dictionary keys to obtain information, from the kAudioSessionProperty_AudioRouteChange property, about an audio hardware route change event.
This table lists the result codes defined for Audio Session Services.
| Result Code | Value | Description |
|---|---|---|
kAudioSessionNoError | 0 | No error has occurred. Available in iPhone OS 2.0 and later. |
kAudioSessionNotInitialized | '!ini' | An Audio Session Services function was called without first initializing the session. To avoid this error, call the Available in iPhone OS 2.0 and later. |
kAudioSessionAlreadyInitialized | 'init' | The Available in iPhone OS 2.0 and later. |
kAudioSessionInitializationError | ''ini?' | There was an error during audio session initialization. Available in iPhone OS 2.0 and later. |
kAudioSessionUnsupportedPropertyError | 'pty?' | The audio session property is not supported. Available in iPhone OS 2.0 and later. |
kAudioSessionBadPropertySizeError | '!siz' | The size of the audio session property data was not correct. Available in iPhone OS 2.0 and later. |
kAudioSessionNotActiveError | '!act' | The audio operation failed because your application’s audio session was not active. Available in iPhone OS 2.0 and later. |
kAudioServicesNoHardwareError | 'nohw' | The audio operation failed because the device has no audio input available. Available in iPhone OS 3.0 and later. |
kAudioSessionNoCategorySet | '?cat' | The audio operation failed because it requires the audio session to have an explicitly-set category, but none was set. To use a hardware codec you must explicitly initialize the audio session and explicitly set an audio session category. Available in iPhone OS 3.1 and later. |
kAudioSessionIncompatibleCategory | '!cat' | The specified audio session category cannot be used for the attempted audio operation. For example, you attempted to play or record audio with the audio session category set to Available in iPhone OS 3.1 and later. |
Last updated: 2009-08-31