---
title: "AudioCodecSetProperty(_:_:_:_:)"
framework: audiotoolbox
role: symbol
role_heading: Function
path: "audiotoolbox/audiocodecsetproperty(_:_:_:_:)"
---

# AudioCodecSetProperty(_:_:_:_:)

Sets the value of a codec property.

## Declaration

```swift
func AudioCodecSetProperty(_ inCodec: AudioCodec, _ inPropertyID: AudioCodecPropertyID, _ inPropertyDataSize: UInt32, _ inPropertyData: UnsafeRawPointer) -> OSStatus
```

## Parameters

- `inCodec`: An audio codec object. Because an audio codec object is a Component Manger component instance, you can use the Component Manager (for example, the functions doc://com.apple.documentation/documentation/coreservices/1516552-findnextcomponent and OpenAComponent) to obtain an audio codec object.
- `inPropertyID`: Property ID of the property whose value you want to set. Settable codec property IDs are listed in doc://com.apple.audiotoolbox/documentation/AudioToolbox/1494111-instance-codec-properties.
- `inPropertyDataSize`: Size in bytes of the property value data.
- `inPropertyData`: Pointer to the data buffer containing the property value.

## Return Value

Return Value Returns NoErr if successful, otherwise, a result code. See Result Codes for a list of possible values.

## Discussion

Discussion Codec properties are classified as either global properties, which remain the same for all instances of a codec, or instance properties, which may vary from instance to instance. However, not all instance property values can be modified. See Instance Codec Properties for details. No property values can be modified when the codec is in the initialized state. You must call this function before you call the AudioCodecInitialize(_:_:_:_:_:) function, or after you call the AudioCodecUninitialize(_:) function. Call the AudioCodecGetProperty(_:_:_:_:) function to retrieve the current value of a property.

## See Also

### Related Documentation

- [AudioCodecUninitialize(_:)](audiotoolbox/audiocodecuninitialize(_:).md)
- [AudioCodecInitialize(_:_:_:_:_:)](audiotoolbox/audiocodecinitialize(_:_:_:_:_:).md)

### Accessing Codec Properties

- [AudioCodecGetProperty(_:_:_:_:)](audiotoolbox/audiocodecgetproperty(_:_:_:_:).md)
- [AudioCodecGetPropertyInfo(_:_:_:_:)](audiotoolbox/audiocodecgetpropertyinfo(_:_:_:_:).md)
