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

# MusicTrackGetProperty(_:_:_:_:)

Gets a music track property value.

```
func MusicTrackGetProperty(_ inTrack: MusicTrack, _ inPropertyID: UInt32, _ outData: UnsafeMutableRawPointer, _ ioLength: UnsafeMutablePointer<UInt32>) -> OSStatus
```

## Parameters

`inTrack`

The music track that you want to get a property value from.

`inPropertyID`

The identifier for the music track property that you want to get. See [Music Track Properties](/documentation/AudioToolbox/1515456-music-track-properties) for possible values.

`outData`

On output, the requested property value.

`ioLength`

On input, the available size for the retrieved property value. On output, the size of the valid property data that `outData` points to.

## Return Value

A result code.

## Discussion

Music track property values are always accessed by reference. As of OS X v10.6, all such property values are fixed length.

This function’s main purpose is to retrieve a music track property value, but you also use it to obtain the size of a variable-length property. Do this, prior to retrieving a variable-length property value, to ensure that you allocate enough memory in `outData` to hold the value.

To obtain a property value’s size, call this function with the `outData` parameter set to `NULL`. On output, the `ioLength` parameter contains the property size.

---

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)