<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioToolbox",
  "identifier" : "/documentation/AudioToolbox/MusicTrackLoopInfo/init(loopDuration:numberOfLoops:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Audio Toolbox"
    ],
    "preciseIdentifier" : "s:So18MusicTrackLoopInfoV12loopDuration13numberOfLoopsABSd_s5Int32Vtcfc"
  },
  "title" : "init(loopDuration:numberOfLoops:)"
}
-->

# init(loopDuration:numberOfLoops:)

Initializes the music track loop information.

```
init(loopDuration: MusicTimeStamp, numberOfLoops: Int32)
```

## Parameters

`loopDuration`

The point in a music track, measured in beats from the end of the music track, at which to begin playback during looped playback. To explicitly turn off looping, specify a loopDuration of `0`.

`numberOfLoops`

The number of times to play the designated portion of the music track. To loop forever, set numberOfLoops to `0`.

---

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)