---
title: "setPreferredOutputNumberOfChannels(_:)"
framework: avfaudio
role: symbol
role_heading: Instance Method
path: "avfaudio/avaudiosession/setpreferredoutputnumberofchannels(_:)"
---

# setPreferredOutputNumberOfChannels(_:)

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

## Declaration

```swift
func setPreferredOutputNumberOfChannels(_ count: Int) throws
```

## Parameters

- `count`: The number of output channels you want to use.

## Discussion

Discussion This method requests a change to the number of output channels. To determine whether the change has taken effect, use the outputNumberOfChannels property. For details, see Configuring standard audio behaviors. Requesting output channels less than one or greater than that returned by the maximumOutputNumberOfChannels results in an error. Only certain devices and peripherals support this feature. Set the preferred number of output channels only after setting the audio session’s category and mode, and activating the session.

## See Also

### Setting the number of output channels

- [preferredOutputNumberOfChannels](avfaudio/avaudiosession/preferredoutputnumberofchannels.md)
- [outputNumberOfChannels](avfaudio/avaudiosession/outputnumberofchannels.md)
- [maximumOutputNumberOfChannels](avfaudio/avaudiosession/maximumoutputnumberofchannels.md)
