---
title: "MusicTrackGetProperty(_:_:_:_:)"
framework: audiotoolbox
role: symbol
role_heading: Function
path: "audiotoolbox/musictrackgetproperty(_:_:_:_:)"
---

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

Gets a music track property value.

## Declaration

```swift
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 doc://com.apple.audiotoolbox/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

Return Value A result code.

## Discussion

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.

## See Also

### Managing Music Tracks

- [MusicTrackClear(_:_:_:)](audiotoolbox/musictrackclear(_:_:_:).md)
- [MusicTrackCopyInsert(_:_:_:_:_:)](audiotoolbox/musictrackcopyinsert(_:_:_:_:_:).md)
- [MusicTrackCut(_:_:_:)](audiotoolbox/musictrackcut(_:_:_:).md)
- [MusicTrackGetDestMIDIEndpoint(_:_:)](audiotoolbox/musictrackgetdestmidiendpoint(_:_:).md)
- [MusicTrackGetDestNode(_:_:)](audiotoolbox/musictrackgetdestnode(_:_:).md)
- [MusicTrackGetSequence(_:_:)](audiotoolbox/musictrackgetsequence(_:_:).md)
- [MusicTrackMerge(_:_:_:_:_:)](audiotoolbox/musictrackmerge(_:_:_:_:_:).md)
- [MusicTrackMoveEvents(_:_:_:_:)](audiotoolbox/musictrackmoveevents(_:_:_:_:).md)
- [MusicTrackNewAUPresetEvent(_:_:_:)](audiotoolbox/musictracknewaupresetevent(_:_:_:).md)
- [MusicTrackNewExtendedNoteEvent(_:_:_:)](audiotoolbox/musictracknewextendednoteevent(_:_:_:).md)
- [MusicTrackNewExtendedTempoEvent(_:_:_:)](audiotoolbox/musictracknewextendedtempoevent(_:_:_:).md)
- [MusicTrackNewMIDIChannelEvent(_:_:_:)](audiotoolbox/musictracknewmidichannelevent(_:_:_:).md)
- [MusicTrackNewMIDINoteEvent(_:_:_:)](audiotoolbox/musictracknewmidinoteevent(_:_:_:).md)
- [MusicTrackNewMIDIRawDataEvent(_:_:_:)](audiotoolbox/musictracknewmidirawdataevent(_:_:_:).md)
- [MusicTrackNewMetaEvent(_:_:_:)](audiotoolbox/musictracknewmetaevent(_:_:_:).md)
