Instance Method

setPreferredInputNumberOfChannels:error:

Sets the preferred number of input channels for the current route.

Declaration

- (BOOL)setPreferredInputNumberOfChannels:(NSInteger)count error:(NSError * _Nullable *)outError;

Parameters

count

The number of input channels 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 a request was successfully made, or NO otherwise.

Discussion

This method requests a change to the number of input channels. To determine whether the change takes effect, query or key-value observe the inputNumberOfChannels property.

Requesting a number of input channels less than one or greater than that returned by the maximumInputNumberOfChannels results in an error.

You must set a preferred number of input channels only after setting the audio session’s category and mode and activating the session.

See Also

Working with Audio Channels

inputNumberOfChannels

The number of audio input channels for the current route.

maximumInputNumberOfChannels

The maximum number of input channels available for the current audio route.

preferredInputNumberOfChannels

The preferred number of input channels for the current route.

outputNumberOfChannels

The number of audio output channels.

maximumOutputNumberOfChannels

The maximum number of output channels available for the current audio route.

preferredOutputNumberOfChannels

The preferred number of output channels for the current route.

- setPreferredOutputNumberOfChannels:error:

Sets the preferred number of output channels for the current route.