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

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

Sets the value of a codec property.

```
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 [Instance Codec Properties](/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

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

## 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](/documentation/AudioToolbox/1494111-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(_:_:_:_:_:)`](/documentation/AudioToolbox/AudioCodecInitialize(_:_:_:_:_:)) function, or after you call the [`AudioCodecUninitialize(_:)`](/documentation/AudioToolbox/AudioCodecUninitialize(_:)) function. Call the [`AudioCodecGetProperty(_:_:_:_:)`](/documentation/AudioToolbox/AudioCodecGetProperty(_:_:_:_:)) function to retrieve the current value of a property.

## See Also

[`AudioCodecUninitialize(_:)`](/documentation/AudioToolbox/AudioCodecUninitialize(_:))

Moves the codec from the initialized state back to the uninitialized state.

[`AudioCodecInitialize(_:_:_:_:_:)`](/documentation/AudioToolbox/AudioCodecInitialize(_:_:_:_:_:))

Sets up the specified codec to perform a data format translation.



---

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)