Skip to content

API Interface MusicEventHandle

github-actions[bot] edited this page Nov 29, 2026 · 2 revisions

Interface: MusicEventHandle

Defined in: src/engine/core/musicEvents.ts:41

The part of a playing event's handle that music callbacks carry (§1.2). The audio plugin's AudioEventHandle extends this; the engine names only this shape so it never imports the plugin.

Extended by

Properties

music

readonly music: MusicHandle | undefined;

Defined in: src/engine/core/musicEvents.ts:45

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


playing

readonly playing: boolean;

Defined in: src/engine/core/musicEvents.ts:43

True until the instance ends or is stopped.

Methods

onMusic()

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

Defined in: src/engine/core/musicEvents.ts:50

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


trigger()

trigger(name): boolean;

Defined in: src/engine/core/musicEvents.ts:55

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

Clone this wiki locally