<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioSession/setPreferredOutputNumberOfChannels(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAudioSession(im)setPreferredOutputNumberOfChannels:error:"
  },
  "title" : "setPreferredOutputNumberOfChannels(_:)"
}
-->

# setPreferredOutputNumberOfChannels(_:)

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

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

## Parameters

`count`

The number of output channels you want to use.

## Discussion

This method requests a change to the number of output channels. To determine whether the change has taken effect, use the [`outputNumberOfChannels`](/documentation/AVFAudio/AVAudioSession/outputNumberOfChannels) property. For details, see Configuring standard audio behaviors. Requesting output channels less than one or greater than that returned by the [`maximumOutputNumberOfChannels`](/documentation/AVFAudio/AVAudioSession/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)