API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classAudioStream
Streaming long-form audio backed by an `HTMLAudioElement` - background tracks, voice-over, **and internet radio** (same mechanism, low CPU/RAM). Decoded lazily via the browser's media pipeline, so memory cost scales with the decode buffer rather than total duration. `AudioStream` is a **data descriptor**: it holds the media element and default playback parameters but does not play itself. Playback is driven by `AudioSystem.play(stream, options)`, which returns an AudioStreamVoice for fine-grained control (pause/resume, seek, loop, rate, volume, spatial). Because an `HTMLAudioElement` has a single playhead, a stream has **one active voice at a time** - playing again stops the previous voice. Routes through the system's `music` bus by default (override via PlayOptions.bus). Use Sound for short, frequently-triggered clips that benefit from pre-decoded `AudioBuffer` storage and pooled overlapping playback.
import { AudioStream } from '@codexo/exojs'Streaming long-form audio backed by an `HTMLAudioElement` - background tracks, voice-over, **and internet radio** (same mechanism, low CPU/RAM). Decoded lazily via the browser's media pipeline, so memory cost scales with the decode buffer rather than total duration.
`AudioStream` is a **data descriptor**: it holds the media element and default playback parameters but does not play itself. Playback is driven by `AudioSystem.play(stream, options)`, which returns an AudioStreamVoice for fine-grained control (pause/resume, seek, loop, rate, volume, spatial).
Because an `HTMLAudioElement` has a single playhead, a stream has **one active voice at a time** - playing again stops the previous voice. Routes through the system's `music` bus by default (override via PlayOptions.bus).
Use Sound for short, frequently-triggered clips that benefit from pre-decoded `AudioBuffer` storage and pooled overlapping playback.
new(audioElement: HTMLAudioElement, options?: Partial<PlaybackOptionsCommon playback configuration for Sound and AudioStream.>): AudioStreamcreateVoice(system: AudioSystemPer-Application owner of the audio mix: three pre-configured AudioBus instances (`master` ← `music` + `sound`), a single AudioListener for spatial audio, and a…, options: PlayOptionsPer-play overrides passed to AudioSystem.play.): VoiceA live playback instance in the audio graph with a control surface. A Voice is created by playing a Playable via AudioSystem.play (and, later, by opening an `A…destroy(): voidloop: booleanmuted: booleanplaybackRate: numbervolume: numberaudioElement: HTMLMediaElementdestroyed: booleanduration: number