EZ Web Audio / playTogether
Function: playTogether()
playTogether(
playables):Promise<void>
Defined in: utils/play-together.ts:27
Play multiple sounds synchronized to the exact same AudioContext timestamp.
Uses playAt() with a shared start time slightly in the future to ensure all sources begin at precisely the same moment. This is more accurate than calling play() on each sound sequentially, which would introduce tiny timing differences.
Parameters
playables
Playable[]
Array of Playable instances (Sound, Track, Oscillator, etc.)
Returns
Promise<void>
Promise that resolves when all sounds have started
Example
typescript
import { createSound, playTogether } from 'ez-web-audio'
const kick = await createSound('kick.mp3')
const snare = await createSound('snare.mp3')
const hihat = await createSound('hihat.mp3')
await playTogether([kick, snare, hihat])
// All three start at the exact same AudioContext time