Skip to content

@liminal-hq/undertone / PlaybackHandle

Interface: PlaybackHandle ​

Defined in: engine.ts:98

Returned by play(), playVoices() and playParams(): the scheduled voices' time window, and a way to stop them early. Safe to call stop() any number of times, before or after the voices have started or finished.

Properties ​

endTime ​

readonly endTime: number

Defined in: engine.ts:102

Latest time any voice in this playback is still sounding (after its release), on the context's clock.


startTime ​

readonly startTime: number

Defined in: engine.ts:100

Earliest start time of any voice in this playback, on the context's clock.

Methods ​

stop() ​

stop(when?, options?): void

Defined in: engine.ts:109

Stops every voice at when (default: now) with a short fade. Voices that have not started yet never sound; voices that already finished are untouched. Without cancelScheduledValues on the context's params the voice is cut hard instead of faded.

Parameters ​

when? ​

number

options? ​

StopOptions

Returns ​

void