API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classMusic

@codexo/exojs / audio / stable

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.

11
props
18
methods
2
events
Import
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.

Constructors 1
new(audioElement: HTMLAudioElement, options?: Partial<PlaybackOptions>): Music
Methods 18
_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
Properties 11
analyserTarget: AudioNode | null
bus: AudioBus
currentTime: number
duration: number
loop: boolean
muted: boolean
paused: boolean
playbackRate: number
playing: boolean
progress: number
volume: number
Events 2
onStart: Signal<[]>
onStop: Signal<[]>
Source