Deprecated AVAudioSession Methods
A method identified as deprecated has been superseded and may become unsupported in the future.
Deprecated in iOS 6.0
currentHardwareInputNumberOfChannels
The number of audio hardware input channels. (read-only) (Deprecated in iOS 6.0. Use inputNumberOfChannels instead.)
Availability
- Available in iOS 3.0 and later.
- Deprecated in iOS 6.0.
Declared In
AVAudioSession.hcurrentHardwareOutputNumberOfChannels
The number of audio hardware output channels. (read-only) (Deprecated in iOS 6.0. Use outputNumberOfChannels instead.)
Availability
- Available in iOS 3.0 and later.
- Deprecated in iOS 6.0.
Declared In
AVAudioSession.hcurrentHardwareSampleRate
The audio hardware sample rate, in hertz. (read-only) (Deprecated in iOS 6.0. Use sampleRate instead)
Discussion
The audio hardware input and output sample rates are always equal to each other when input and output are both running.
Obtain the value of this property after activating your audio session. After successful activation, the value of this property does not change while your session remains active.
Availability
- Available in iOS 3.0 and later.
- Deprecated in iOS 6.0.
Declared In
AVAudioSession.hdelegate
Specifies the delegate object for the audio session. (Deprecated in iOS 6.0. Use the notifications described in the Notifications section of this class instead.)
Discussion
The delegate object must implement the protocol described in AVAudioSessionDelegate Protocol Reference.
Availability
- Available in iOS 3.0 and later.
- Deprecated in iOS 6.0.
Declared In
AVAudioSession.hinputIsAvailable
A Boolean value that indicates whether a hardware audio input path is available (YES), or not (NO). (read-only) (Deprecated in iOS 6.0. Use inputAvailable instead.)
Discussion
Use this method on launch to determine whether the device your app is running on supports audio input. To respond to a change in the availability of audio input, implement the inputIsAvailableChanged: delegate method.
Availability
- Available in iOS 3.0 and later.
- Deprecated in iOS 6.0.
Declared In
AVAudioSession.hpreferredHardwareSampleRate
The preferred hardware sample rate, in hertz. (read-only) (Deprecated in iOS 6.0. Use preferredSampleRate instead.)
Availability
- Available in iOS 3.0 and later.
- Deprecated in iOS 6.0.
Declared In
AVAudioSession.hsetActive:withFlags:error:
Activates or deactivates your app’s audio session; provides flags for use by other audio sessions. (Deprecated in iOS 6.0. Use setActive:withOptions:error: instead.)
Parameters
- beActive
Use
YESto activate your app’s audio session orNOto deactivate it.- flags
A bitmapped value containing one or more flags from the “Activation Flags” enumeration.
- outError
Pass in the address of a
nil-initializedNSErrorobject. If an error occurs, upon return theNSErrorobject describes the error. If you do not want error information, pass inNULL.
Return Value
Returns YES on success or NO on failure.
Discussion
If another app’s active audio session has higher priority than your app, and that other audio session does not allow mixing with other apps, attempting to activate your audio session may fail.
Availability
- Available in iOS 4.0 and later.
- Deprecated in iOS 6.0.
Declared In
AVAudioSession.hsetPreferredHardwareSampleRate:error:
Sets the preferred hardware sample rate for input and output. (Deprecated in iOS 6.0. Use setPreferredSampleRate:error: instead.)
Parameters
- sampleRate
The hardware sample rate you want to use. The available range for hardware sample rate is device dependent. It typically ranges from 8,000 through 48,000 hertz.
- outError
Pass in the address of a
nil-initializedNSErrorobject. If an error occurs, upon return theNSErrorobject describes the error. If you do not want error information, pass inNULL.
Return Value
Returns YES on success or NO on failure.
Discussion
The audio hardware input and output sample rates are always equal to each other when input and output are both running.
For more information see “Querying and Using Audio Hardware Characteristics” in Audio Session Programming Guide.
Availability
- Available in iOS 3.0 and later.
- Deprecated in iOS 6.0.
Declared In
AVAudioSession.h© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-12-13)