<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/Audio/prepareAudio(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation5AudioO07prepareC0yAA0C23PlaybackGroupControllerCSayAA0C8ResourceC_AA6EntityCtGKFZ"
  },
  "title" : "prepareAudio(_:)"
}
-->

# prepareAudio(_:)

Prepares multiple audio resources for synchronized playback without starting them.

```
@MainActor static func prepareAudio(_ resourcesAndEntities: [(AudioResource, Entity)]) throws -> AudioPlaybackGroupController
```

## Parameters

`resourcesAndEntities`

An array of tuples pairing each audio resource
with the entity that emits it. The same entity may appear multiple times with
different resources, and a single entity can participate in multiple groups.

## Return Value

A controller that coordinates playback of the synchronized group.

## Discussion

Use this method to set up a group of audio sources that you want to play together.
Each resource is paired with the entity that emits it. Call
[`play()`](/documentation/RealityKit/AudioPlaybackGroupController/play()) or
[`play(at:)`](/documentation/RealityKit/AudioPlaybackGroupController/play(at:)) to begin playback.

> Throws: An error if audio preparation fails.

---

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)