Skip to content

API Interface AudioLineHandle

github-actions[bot] edited this page Nov 24, 2026 · 4 revisions

Interface: AudioLineHandle

Defined in: src/plugins/audio/runtime/localisation/lines.ts:54

ADR 0354 §5, 0355 §5: a voice-over line's handle (Audio.line, Audio.say).

Extends

Properties

duration

readonly duration: number;

Defined in: src/plugins/audio/runtime/localisation/lines.ts:62

Seconds of the heard file, or the subtitle's reading time for a subtitle-only line.


event

readonly event: string | null;

Defined in: src/plugins/audio/runtime/localisation/lines.ts:67

ADR 0355 §5: the dialogue event that said it; null for Audio.line.


finished

readonly finished: Promise<LineEnd>;

Defined in: src/plugins/audio/runtime/localisation/lines.ts:63


key

readonly key: string;

Defined in: src/plugins/audio/runtime/localisation/lines.ts:55


language

readonly language: string | null;

Defined in: src/plugins/audio/runtime/localisation/lines.ts:58

The language actually heard (after fallback); null when nothing plays (subtitle-only, refused).


music

readonly music: MusicHandle | undefined;

Defined in: src/engine/audio/musicTypes.ts:44

The music state; undefined unless the event's root is a segment, playlist or musicSwitch.

Inherited from

AudioPlaylistHandle.music


occlusion

readonly occlusion: number;

Defined in: src/plugins/audio/runtime/backend.ts:62

ADR 0162 §1.1: the smoothed dry occlusion gain (1 open, lower as walls muffle it), read from the main-thread mirror.

Inherited from

AudioPlaylistHandle.occlusion


panner

readonly panner: AudioPanner | null;

Defined in: src/plugins/audio/runtime/backend.ts:60

ADR 0162 §1.1: the panner the sound uses ("flat", "equalPower", "hrtf", "bed" or "ambisonic"), read from the main-thread mirror; null once it has ended.

Inherited from

AudioPlaylistHandle.panner


path

readonly path: readonly string[] | null;

Defined in: src/plugins/audio/runtime/localisation/lines.ts:69

ADR 0355 §5: the event's path that matched; null for Audio.line.


paused

readonly paused: boolean;

Defined in: src/plugins/audio/runtime/backend.ts:269

ADR 0362 §1: true from pause() until resume() or stop().

Inherited from

AudioPlaylistHandle.paused


playing

readonly playing: boolean;

Defined in: src/plugins/audio/runtime/backend.ts:52

True from the call to playOneShot until the sound ends or is stopped. Virtual, bus-muted, locked and waiting-for-data sounds are playing (they exist and keep time). Stolen and failed sounds are not. Natural ends are seen up to one frame late.

Inherited from

AudioPlaylistHandle.playing


position

position: Vec3Like | null;

Defined in: src/plugins/audio/runtime/backend.ts:247

Where a spatial playlist plays; set it to move it. Null for a flat one.

Inherited from

AudioPlaylistHandle.position


reason

readonly reason: AudioReason | null;

Defined in: src/plugins/audio/runtime/backend.ts:54

Why it isn't audible (while playing) or why it ended early ("stolen", "failed"); null when audible, or finished or stopped normally.

Inherited from

AudioPlaylistHandle.reason


speaker

readonly speaker: string | null;

Defined in: src/plugins/audio/runtime/localisation/lines.ts:56


state

readonly state: "playing" | "ended" | "queued";

Defined in: src/plugins/audio/runtime/localisation/lines.ts:65

ADR 0355 §5: waiting in its speaker channel's queue, playing, or over.


text

readonly text: string | null;

Defined in: src/plugins/audio/runtime/localisation/lines.ts:60

The subtitle in the subtitle language, read live; null without one.

Methods

fade()

fade(to, seconds): void;

Defined in: src/plugins/audio/runtime/backend.ts:58

Ease this sound's own gain multiplier to to (linear, 0..4) over seconds (0 = at once).

Parameters

to

number

seconds

number

Returns

void

Inherited from

AudioPlaylistHandle.fade


getParameter()

getParameter(name): string | number | undefined;

Defined in: src/plugins/audio/runtime/backend.ts:245

One of the playlist's parameters, else a global one; undefined if neither.

Parameters

name

string

Returns

string | number | undefined

Inherited from

AudioPlaylistHandle.getParameter


onMarker()

onMarker(type, fn): () => void;

Defined in: src/plugins/audio/runtime/backend.ts:258

Call fn each time a Cue, Exit or Hit marker of a playing sample, or a sequence's cue or exit marker, passes. Returns an unsubscribe function. Markers are found on main from the planned playhead or voice position and reported on the first frame whose heard clock has passed them (e.time is the exact heard time).

Parameters

type

AudioMarkerType

fn

(e) => void

Returns

() => void

Inherited from

AudioPlaylistHandle.onMarker


onMusic()

onMusic(kind, fn): () => void;

Defined in: src/engine/audio/musicTypes.ts:49

Subscribe to beat, bar or cue events of this music instance, for scripts that Audio.play music with no node (M4c; owner decision 3). Returns an unsubscribe function. A non-music handle returns a no-op function.

Parameters

kind

MusicKind

fn

(e) => void

Returns

() => void

Inherited from

AudioPlaylistHandle.onMusic


pause()

pause(): void;

Defined in: src/plugins/audio/runtime/backend.ts:265

ADR 0362 §1: hold the playback where it is: its voices, timers, sequence clock and pending picks wait, and resume() continues it from that same position (the musical clock, markers and beat callbacks hold too). Pausing a paused playback, or resuming one that isn't paused, does nothing; stop() stops a paused one. Changes to its parameters while paused take effect when it resumes.

Returns

void

Inherited from

AudioPlaylistHandle.pause


release()

release(): void;

Defined in: src/plugins/audio/runtime/backend.ts:252

Key-off: held loops end by their exit settings, a Blend's envelope releases, a continuous Queue stops picking; the instance ends when its voices do (an untilStopped playlist too). A no-op without any of those.

Returns

void

Inherited from

AudioPlaylistHandle.release


resume()

resume(): void;

Defined in: src/plugins/audio/runtime/backend.ts:267

ADR 0362 §1: continue a paused playback from where it held. A no-op when it isn't paused.

Returns

void

Inherited from

AudioPlaylistHandle.resume


setParameter()

setParameter(name, value): void;

Defined in: src/plugins/audio/runtime/backend.ts:243

Set one of the playlist's own parameters (labelled ones by label). Unknown names warn once.

Parameters

name

string

value

string | number

Returns

void

Inherited from

AudioPlaylistHandle.setParameter


stop()

stop(fadeSeconds?): void;

Defined in: src/plugins/audio/runtime/backend.ts:56

Stop now, or fade to silence over fadeSeconds (default 0) and stop. A second call is a no-op.

Parameters

fadeSeconds?

number

Returns

void

Inherited from

AudioPlaylistHandle.stop


trigger()

trigger(name): boolean;

Defined in: src/engine/audio/musicTypes.ts:54

Fire the stinger whose trigger is name. True when accepted; false when unknown, dropped by dontRepeat or ifTooLate: "skip", or the pool refused it (the debug rows say which).

Parameters

name

string

Returns

boolean

Inherited from

AudioPlaylistHandle.trigger


viseme()

viseme(): AudioViseme | null;

Defined in: src/plugins/audio/runtime/localisation/lines.ts:71

The mouth shape at the heard time (ADR 0354 §7); null without lip-sync data or while nothing plays.

Returns

AudioViseme | null

Clone this wiki locally