---
title: "AudioFileGetProperty(_:_:_:_:)"
framework: audiotoolbox
role: symbol
role_heading: Function
path: "audiotoolbox/audiofilegetproperty(_:_:_:_:)"
---

# AudioFileGetProperty(_:_:_:_:)

Gets the value of an audio file property.

## Declaration

```swift
func AudioFileGetProperty(_ inAudioFile: AudioFileID, _ inPropertyID: AudioFilePropertyID, _ ioDataSize: UnsafeMutablePointer<UInt32>, _ outPropertyData: UnsafeMutableRawPointer) -> OSStatus
```

## Parameters

- `inAudioFile`: The audio file you want to obtain a property value from.
- `inPropertyID`: The property whose value you want. See doc://com.apple.audiotoolbox/documentation/AudioToolbox/1576499-audio-file-properties for possible values.
- `ioDataSize`: On input, the size of the buffer passed in the outPropertyData parameter. On output, the number of bytes written to the buffer. Use the doc://com.apple.audiotoolbox/documentation/AudioToolbox/AudioFileGetPropertyInfo(_:_:_:_:) function to obtain the size of the property value.
- `outPropertyData`: On output, the value of the property specified in the inPropertyID parameter.

## Return Value

Return Value A result code. See Result Codes.

## Discussion

Discussion Some Core Audio property values are C types and others are Core Foundation objects. If you call this function to retrieve a value that is a Core Foundation object, then this function—despite the use of “Get” in its name—duplicates the object. You are responsible for releasing the object, as described in The Create Rule in Memory Management Programming Guide for Core Foundation.

## See Also

### Getting and Setting Audio File Properties

- [AudioFileGetPropertyInfo(_:_:_:_:)](audiotoolbox/audiofilegetpropertyinfo(_:_:_:_:).md)
- [AudioFileSetProperty(_:_:_:_:)](audiotoolbox/audiofilesetproperty(_:_:_:_:).md)
