<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioToolbox",
  "identifier" : "/documentation/AudioToolbox/AUAudioUnit/shouldChange(to:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Audio Toolbox",
      "AudioToolbox"
    ],
    "preciseIdentifier" : "c:objc(cs)AUAudioUnit(im)shouldChangeToFormat:forBus:"
  },
  "title" : "shouldChange(to:for:)"
}
-->

# shouldChange(to:for:)

This is called when you set the format on a bus.

```
func shouldChange(to format: AVAudioFormat, for bus: AUAudioUnitBus) -> Bool
```

## Parameters

`format`

The proposed new format.

`bus`

The bus on which the format will be changed.

## Return Value

- <doc://com.apple.documentation/documentation/Swift/true> if the new format will be set on the bus.

## Discussion

- <doc://com.apple.documentation/documentation/Swift/false> if the new format will not be set on the bus.

## Discussion

The bus has already checked that the format meets its channel constraints. The audio unit can override this method to check the format before allowing it to be set on the bus.

The default implementation returns <doc://com.apple.documentation/documentation/Swift/false> if the audio unit’s [`renderResourcesAllocated`](/documentation/AudioToolbox/AUAudioUnit/renderResourcesAllocated) value is <doc://com.apple.documentation/documentation/Swift/true>.

---

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)