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.)

@property(readonly) NSInteger currentHardwareInputNumberOfChannels
Availability
  • Available in iOS 3.0 and later.
  • Deprecated in iOS 6.0.
Declared In
AVAudioSession.h

currentHardwareOutputNumberOfChannels

The number of audio hardware output channels. (read-only) (Deprecated in iOS 6.0. Use outputNumberOfChannels instead.)

@property(readonly) NSInteger currentHardwareOutputNumberOfChannels
Availability
  • Available in iOS 3.0 and later.
  • Deprecated in iOS 6.0.
Declared In
AVAudioSession.h

currentHardwareSampleRate

The audio hardware sample rate, in hertz. (read-only) (Deprecated in iOS 6.0. Use sampleRate instead)

@property(readonly) double currentHardwareSampleRate
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.h

delegate

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.)

@property(assign) id<AVAudioSessionDelegate> delegate
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.h

inputIsAvailable

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.)

@property(readonly) BOOL inputIsAvailable
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.h

preferredHardwareSampleRate

The preferred hardware sample rate, in hertz. (read-only) (Deprecated in iOS 6.0. Use preferredSampleRate instead.)

@property(readonly) double preferredHardwareSampleRate
Availability
  • Available in iOS 3.0 and later.
  • Deprecated in iOS 6.0.
Declared In
AVAudioSession.h

setActive: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.)

- (BOOL)setActive:(BOOL)beActive withFlags:(NSInteger)flags error:(NSError **)outError
Parameters
beActive

Use YES to activate your app’s audio session or NO to deactivate it.

flags

A bitmapped value containing one or more flags from the “Activation Flags” enumeration.

outError

Pass in the address of a nil-initialized NSError object. If an error occurs, upon return the NSError object describes the error. If you do not want error information, pass in NULL.

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.h

setPreferredHardwareSampleRate:error:

Sets the preferred hardware sample rate for input and output. (Deprecated in iOS 6.0. Use setPreferredSampleRate:error: instead.)

- (BOOL)setPreferredHardwareSampleRate:(double)sampleRate error:(NSError **)outError
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-initialized NSError object. If an error occurs, upon return the NSError object describes the error. If you do not want error information, pass in NULL.

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

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