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 `AudioManager.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 manager'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 `AudioManager.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 manager'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<PlaybackOptions>): AudioStream _createVoice(manager: AudioManager, options: PlayOptions): Voice destroy(): void loop: boolean muted: boolean playbackRate: number volume: number audioElement: HTMLMediaElement duration: number