API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classMusic
Streaming long-form audio backed by an `HTMLAudioElement`. Decoded lazily via the browser's media pipeline, so memory cost scales with decode-buffer size rather than total duration. Routes through the engine's `music` bus by default (overridable via the inherited `bus` setter). Use Sound for short, frequently-triggered clips that benefit from pre-decoded `AudioBuffer` storage and pooled overlapping playback. `Music` is the right choice for background tracks, voice lines, or anything else where a single source per track is enough.
import { Music } from '@codexo/exojs' Streaming long-form audio backed by an `HTMLAudioElement`. Decoded lazily via the browser's media pipeline, so memory cost scales with decode-buffer size rather than total duration. Routes through the engine's `music` bus by default (overridable via the inherited `bus` setter).
Use Sound for short, frequently-triggered clips that benefit from pre-decoded `AudioBuffer` storage and pooled overlapping playback. `Music` is the right choice for background tracks, voice lines, or anything else where a single source per track is enough.
new(audioElement: HTMLAudioElement, options?: Partial<PlaybackOptions>): Music _connectToBus(): void _defaultBus(): AudioBus _disconnectFromBus(): void _getAudioSetup(): object | null applyOptions(options: Partial<PlaybackOptions>): this destroy(): void fadeIn(durationMs: number): this fadeOut(durationMs: number, options: object): this getTime(): number pause(options?: Partial<PlaybackOptions>): this play(options?: Partial<PlaybackOptions>): this setLoop(loop: boolean): this setMuted(muted: boolean): this setPlaybackRate(value: number): this setTime(currentTime: number): this setVolume(value: number): this stop(options?: Partial<PlaybackOptions>): this toggle(options?: Partial<PlaybackOptions>): this analyserTarget: AudioNode | null bus: AudioBus currentTime: number duration: number loop: boolean muted: boolean paused: boolean playbackRate: number playing: boolean progress: number volume: number onStart: Signal<[]> onStop: Signal<[]>