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

# MusicSequenceGetTrackIndex(_:_:_:)

Gets the index number for a specified music track.

```
func MusicSequenceGetTrackIndex(_ inSequence: MusicSequence, _ inTrack: MusicTrack, _ outTrackIndex: UnsafeMutablePointer<UInt32>) -> OSStatus
```

## Parameters

`inSequence`

The music sequence to obtain the track index number from.

`inTrack`

The music track whose index you want to obtain. This function returns an error if the music track is not part of the music sequence specified in the `inSequence` parameter.

`outTrackIndex`

On output, the zero-based index of the music track that you provided in the `inTrack` parameter.

## Return Value

A result code.

## Discussion

This function is for accessing only indexes for music tracks, not the tempo track.

---

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)