---
title: "setBusCount(_:)"
framework: audiotoolbox
role: symbol
role_heading: Instance Method
path: "audiotoolbox/auaudiounitbusarray/setbuscount(_:)"
---

# setBusCount(_:)

Changes the number of busses in the array.

## Declaration

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

## Parameters

- `count`: The new number of busses in the array.

## Discussion

Discussion false if the operation failed. Discussion note: In Swift, this method returns Void and is marked with the throws keyword to indicate that it throws an error in cases of failure. You call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in Error Handling in The Swift Programming Language and About Imported Cocoa Error Parameters.

## See Also

### Bus Array Methods and Properties

- [count](audiotoolbox/auaudiounitbusarray/count.md)
- [isCountChangeable](audiotoolbox/auaudiounitbusarray/iscountchangeable.md)
- [ownerAudioUnit](audiotoolbox/auaudiounitbusarray/owneraudiounit.md)
- [busType](audiotoolbox/auaudiounitbusarray/bustype.md)
- [subscript(_:)](audiotoolbox/auaudiounitbusarray/subscript(_:).md)
- [addObserver(toAllBusses:forKeyPath:options:context:)](audiotoolbox/auaudiounitbusarray/addobserver(toallbusses:forkeypath:options:context:).md)
- [removeObserver(fromAllBusses:forKeyPath:context:)](audiotoolbox/auaudiounitbusarray/removeobserver(fromallbusses:forkeypath:context:).md)
