<!--
{
  "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/AudioCodecGetProperty(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Audio Toolbox"
    ],
    "preciseIdentifier" : "c:@F@AudioCodecGetProperty"
  },
  "title" : "AudioCodecGetProperty(_:_:_:_:)"
}
-->

# AudioCodecGetProperty(_:_:_:_:)

Retrieves the value of a codec property.

```
func AudioCodecGetProperty(_ inCodec: AudioCodec, _ inPropertyID: AudioCodecPropertyID, _ ioPropertyDataSize: UnsafeMutablePointer<UInt32>, _ outPropertyData: UnsafeMutableRawPointer) -> 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 obtain. Codec property IDs are listed in [Global Codec Properties](/documentation/AudioToolbox/1494121-global-codec-properties) and [Instance Codec Properties](/documentation/AudioToolbox/1494111-instance-codec-properties).

`ioPropertyDataSize`

On input, the size in bytes of the data buffer pointed to by the `outPropertyData` parameter. On output, the amount of data actually written to the buffer.

`outPropertyData`

The property data buffer.

## Return Value

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

## Discussion

All property values can be read regardless of the state of the codec. However, the values of some properties depend on whether the codec is initialized. Before calling this function, call the [`AudioCodecGetPropertyInfo(_:_:_:_:)`](/documentation/AudioToolbox/AudioCodecGetPropertyInfo(_:_:_:_:)) function to determine the size of buffer you need for the property 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)