Contents

prepareAudio(_:)

Prepares multiple audio resources for synchronized playback without starting them.

Declaration

@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() or play(at:) to begin playback.

See Also

Playing audio resources