API reference

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

C

classAbstractMedia

@codexo/exojs / audio / stable

Shared base for Sound and Music: holds playback primitives (volume, loop, playbackRate, muted, currentTime), the AudioBus routing slot, lifecycle Signals (`onStart`, `onStop`), and ramp helpers (AbstractMedia.fadeIn, AbstractMedia.fadeOut) that operate on whatever `GainNode` the subclass exposes. Subclasses implement the abstract members to bind to either an `AudioBufferSourceNode` (Sound) or `MediaElementAudioSourceNode` (Music).

11
props
18
methods
2
events
Import
import { AbstractMedia } from '@codexo/exojs'

Shared base for Sound and Music: holds playback primitives (volume, loop, playbackRate, muted, currentTime), the AudioBus routing slot, lifecycle Signals (`onStart`, `onStop`), and ramp helpers (AbstractMedia.fadeIn, AbstractMedia.fadeOut) that operate on whatever `GainNode` the subclass exposes.

Subclasses implement the abstract members to bind to either an `AudioBufferSourceNode` (Sound) or `MediaElementAudioSourceNode` (Music).

Constructors 1
new(initialState: AbstractMediaInitialState): AbstractMedia
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(playbackRate: number): this
setTime(time: number): this
setVolume(volume: 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