Instance Method

setPreferredOutputNumberOfChannels:error:

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

Declaration

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

Parameters

count

The number of output 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 output channels. To determine whether the change takes effect, use the outputNumberOfChannels property. For details see Configuring the Audio Session. Requesting a number of output channels less than one or greater than that returned by the maximumOutputNumberOfChannels results in an error. This feature is supported only on certain devices and peripherals.

You set a preferred number of output 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.

- setPreferredInputNumberOfChannels:error:

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