<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioToolbox",
  "identifier" : "/documentation/AudioToolbox/AudioUnitSetProperty(_:_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Audio Toolbox"
    ],
    "preciseIdentifier" : "c:@F@AudioUnitSetProperty"
  },
  "title" : "AudioUnitSetProperty(_:_:_:_:_:_:)"
}
-->

# AudioUnitSetProperty(_:_:_:_:_:_:)

Sets the value of an audio unit property.

```
func AudioUnitSetProperty(_ inUnit: AudioUnit, _ inID: AudioUnitPropertyID, _ inScope: AudioUnitScope, _ inElement: AudioUnitElement, _ inData: UnsafeRawPointer?, _ inDataSize: UInt32) -> OSStatus
```

## Parameters

`inUnit`

The audio unit that you want to set a property value for.

`inID`

The audio unit property identifier.

`inScope`

The audio unit scope for the property.

`inElement`

The audio unit element for the property.

`inData`

The value that you want to apply to the property. May be `NULL` (see Discussion).

    Always pass property values by reference. For example, for a property value of type     `CFStringRef`    , pass it as     `&myCFString`    .

`inDataSize`

The size of the data you are providing in the `inData` parameter.

## Return Value

A result code.

## Discussion

To clear an audio unit property value, set the `inData` parameter to  `NULL` and set the `inDataSize` parameter to `0`. Clearing properties works only for those properties that do not have a default value.

---

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)