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

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

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

On input, a pointer to an error object. If an error occurs, the pointer is set to an NSError object that describes the error. If you do not want error information, pass in nil.

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.

outError

On input, a pointer to an error object. If an error occurs, the pointer is set to an NSError object that describes the error. If you do not want error information, pass in nil.

Return Value

Returns YES on success or NO on failure.

Availability
  • Available in iOS 3.0 and later.
  • Deprecated in iOS 6.0.
Declared In
AVAudioSession.h