Instance Method

setAggregatedIOPreference:error:

Sets the audio session's aggregated I/O configuration preference.

Declaration

- (BOOL)setAggregatedIOPreference:(AVAudioSessionIOType)inIOType error:(NSError * _Nullable *)outError;

Parameters

inIOType

The aggregated I/O preference that you want to use.

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

YES if the preference was successfully changed, or NO otherwise.

Discussion

Starting with iOS 10, AVCaptureSession has changed its default audio input configuration on iPhones and iPads that support the Live Photos feature.

Apps using AVCaptureSession, in its default audio input configuration (usesApplicationAudioSession = YES, automaticallyConfiguresApplicationAudioSession = YES), that need to guarantee the same behavior as previous versions of iOS should opt-out of this new behavior by setting the aggregated I/O preference to AVAudioSessionIOTypeAggregated.

Apps not using of AVCaptureSession, or using AVCaptureSession in its non-default configuration can ignore this preference. In these cases there is no change in behavior from previous versions of iOS.

Topics

Data Types

AVAudioSessionIOType

Constant values used to specify the audio session's aggregated I/O behavior.