Sets the preferred number of output channels for the current route.
SDKs
- iOS 7.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- AVFoundation
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 output
property. For details see Configuring the Audio Session. Requesting a number of output channels less than one or greater than that returned by the maximum
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.