/** * What the runtime needs of the outside world to make a noise – the counterpart of `Input` on the * way out. The browser side of it is `viewport/SoundLibrary`; a test (and a run started before * anything wired one in) gets `SILENT_AUDIO` and plays to nobody. * * Files, not asset ids: resolving the id is the `BehaviorSystem`'s job, because it is the one * holding the project. Everything below this line only knows bytes and voices. */ export interface AudioSink { /** Starts one voice. `volume` is final (0–1) and every call overlaps whatever is already playing. */ play(file: string, volume: number, loop: boolean): void; /** Silences every voice of that file; `''` silences all of them. */ stop(file: string): void; } export const SILENT_AUDIO: AudioSink = { play: () => {}, stop: () => {}, };