Instance Method

setPreferredOutputNumberOfChannels(_:)

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

Declaration

func setPreferredOutputNumberOfChannels(_ count: Int) throws

Parameters

count

The number of output 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 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

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.

func setPreferredInputNumberOfChannels(Int)

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software