Wraps an AnalyserNode for visualization and level metering. Acts as a
pass-through node — connect a source to input and (optionally)
output onward — so it can tap any point of the graph without changing
the signal. Reuse the out typed arrays across frames to avoid per-frame
allocation.
A named mixing group. Sources connect to input; the signal passes
through a volume GainNode, then an ordered effect chain, then on to a
parent node (another bus or the context destination). Volume and effects
cascade: routing sfx → master → destination means the effective gain is
the product of every bus gain along the way.
A decoded sound, ready for playback. Thin wrapper over a Web Audio AudioBuffer that carries the source URL/name and some convenience accessors. Produced by AudioLoader / AudioEngine.load.
The central audio API: a thin, game-oriented layer over the Web Audio API.
Owns one AudioContext, a tree of AudioBuses (master plus
sfx / music / ui / voice), an AudioLoader, and the pool of
live SoundHandle voices.
Loads and decodes audio files into AudioClips, caching results so the
same URL is fetched and decoded only once. In-flight loads are deduped: two
concurrent load(url) calls share a single fetch+decode.
Live microphone input. Wraps getUserMedia + a MediaStreamAudioSourceNode
and exposes an output node plus a built-in analyser for level
metering / visualization. The raw input is not routed to the speakers by
default (to avoid feedback); call connect to route it somewhere — a
bus input, an effect, or another analyser.
A single playing voice: BufferSource → Gain → [Panner] → destination.
Returned by AudioEngine.play / AudioEngine.playAt so callers
can control or stop the sound. Disposes itself when playback ends; the owning
engine prunes finished handles and advances any follow target.
Options for AudioAnalyser.
Options for AudioEngine.playMusic.
Minimal structural 3D point — Vec3 satisfies this.
Anything with a world position — a GameObject satisfies this.
Per-source spatialization parameters (maps onto PannerNode).
Options for a single played voice (AudioEngine.play / playAt).
Built-in bus names always present on a fresh AudioEngine.
Generates a synthetic impulse response: exponentially-decaying white noise.
Pure (aside from the ctx.createBuffer allocation) so it can be unit-tested
with a minimal mock context. random defaults to Math.random and can
be injected for deterministic tests.
Convolution reverb with a generated impulse response and a wet/dry mix.
input fans out to a dry path and a convolver (wet) path that sum at output.
A BiquadFilterNode (lowpass, highpass, bandpass, …) as an effect.
A feedback delay line (echo) with a wet/dry mix.
Builds a waveshaper transfer curve. amount 0 → near-linear, higher →
harder clipping. Pure and allocation-only — unit-testable. The curve is an
odd function (f(-x) = -f(x)) and monotonically increasing.
A WaveShaperNode distortion/overdrive.
A DynamicsCompressorNode. Defaults give gentle glue compression; a
high ratio with a low threshold acts as a master limiter to tame peaks.
The audio subsystem: the standalone AudioEngine (mixing buses, one-shot and spatial SFX, looping music with crossfade, an effects rack, microphone capture, FFT/level analysis) plus the
AudioSource/AudioListenerscene components.