Instance Method

setPreferredInputNumberOfChannels(_:)

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

Declaration

func setPreferredInputNumberOfChannels(_ count: Int) throws

Parameters

count

The number of input channels you want to use.

Return Value

true if a request was successfully made, or false 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

var inputNumberOfChannels: Int

The number of audio input channels for the current route.

var maximumInputNumberOfChannels: Int

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

var preferredInputNumberOfChannels: Int

The preferred number of input channels for the current route.

var outputNumberOfChannels: Int

The number of audio output channels.

var maximumOutputNumberOfChannels: Int

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

var preferredOutputNumberOfChannels: Int

The preferred number of output channels for the current route.

func setPreferredOutputNumberOfChannels(Int)

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