---
title: "AudioCodecGetProperty(_:_:_:_:)"
framework: audiotoolbox
role: symbol
role_heading: Function
path: "audiotoolbox/audiocodecgetproperty(_:_:_:_:)"
---

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

Retrieves the value of a codec property.

## Declaration

```swift
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 doc://com.apple.audiotoolbox/documentation/AudioToolbox/1494121-global-codec-properties and doc://com.apple.audiotoolbox/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

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

## Discussion

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(_:_:_:_:) function to determine the size of buffer you need for the property value.

## See Also

### Accessing Codec Properties

- [AudioCodecGetPropertyInfo(_:_:_:_:)](audiotoolbox/audiocodecgetpropertyinfo(_:_:_:_:).md)
- [AudioCodecSetProperty(_:_:_:_:)](audiotoolbox/audiocodecsetproperty(_:_:_:_:).md)
