API reference

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

C

classAudioStream

@codexo/exojs / audio / stable

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.

6
props
2
methods
0
events
Import
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.

Constructors 1
new(audioElement: HTMLAudioElement, options?: Partial<PlaybackOptions>): AudioStream
Methods 2
_createVoice(manager: AudioManager, options: PlayOptions): Voice
destroy(): void
Properties 6
loop: boolean
muted: boolean
playbackRate: number
volume: number
audioElement: HTMLMediaElement
duration: number
Source