Audio · interface
SoundSource
Explained in Your first game.
interface SoundSourceimport type { SoundSource } from '@driftengine/audio';Properties
| Name | Type | Description |
|---|---|---|
urls | readonly string[] | Candidate locations, tried in order; the first that loads wins.MoreA list rather than one path so a slot can accept whatever format the sound actually arrives in. Asking a composer to transcode before they can hear their track in the game is friction with nothing on the other side of it — the browser decodes all of these natively. |
synthoptional | (ctx: BaseAudioContext) => AudioBuffer | Built only when no candidate is present or usable.MoreOmitted, the slot is required. A stand-in is right for a footstep and wrong for a score
that has to be the file or nothing a game would ship, which until now could not be registered
at all and was decoded outside the registry. A required slot none of whose candidates loads is
recorded in |