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

# MusicPlayerPreroll(_:)

Prepares a music player to play.

```
func MusicPlayerPreroll(_ inPlayer: MusicPlayer) -> OSStatus
```

## Parameters

`inPlayer`

The music player to prepare to play.

## Return Value

A result code

## Discussion

Call this function in advance of playback to reduce a music player’s startup latency. If you call [`MusicPlayerStart(_:)`](/documentation/AudioToolbox/MusicPlayerStart(_:)) without first calling this function, the player will call this function before beginning playback.

---

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)