---
title: "AudioUnitSetProperty(_:_:_:_:_:_:)"
framework: audiotoolbox
role: symbol
role_heading: Function
path: "audiotoolbox/audiounitsetproperty(_:_:_:_:_:_:)"
---

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

Sets the value of an audio unit property.

## Declaration

```swift
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.

## Mentioned in

Migrating Your Audio Unit Host to the AUv3 API

## Return Value

Return Value A result code.

## Discussion

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.

## See Also

### Configuring Audio Unit Properties

- [AudioUnitGetProperty(_:_:_:_:_:_:)](audiotoolbox/audiounitgetproperty(_:_:_:_:_:_:).md)
- [AudioUnitGetPropertyInfo(_:_:_:_:_:_:)](audiotoolbox/audiounitgetpropertyinfo(_:_:_:_:_:_:).md)
- [AudioUnitAddPropertyListener(_:_:_:_:)](audiotoolbox/audiounitaddpropertylistener(_:_:_:_:).md)
- [AudioUnitRemovePropertyListenerWithUserData(_:_:_:_:)](audiotoolbox/audiounitremovepropertylistenerwithuserdata(_:_:_:_:).md)
