Skip to content

EZ Web Audio / playAll

Function: playAll()

playAll(sounds): Promise<void>

Defined in: utils/collections.ts:125

Plays all playable sounds in the provided array. Supports nested arrays which are recursively flattened. Uses best-effort error handling - attempts to play all sounds even if some fail.

Parameters

sounds

NestedArray<Playable>

Array of Playable instances or nested arrays of Playables

Returns

Promise<void>

Throws

CollectionError if any sounds fail to play

Example

typescript
const sounds = [sound1, sound2, [sound3, sound4]]
await playAll(sounds)