API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classAudioListener
Observer position that spatial voices of one Application are panned against. Read each frame from AudioListener.target when one is set, else written directly via AudioListener.position. **Virtual, not the WebAudio listener.** `AudioContext.listener` belongs to the process-wide context, so it is a single global object - two Applications writing their own world position into it every frame would simply overwrite each other, and both mixes would pan against whichever ticked last. This class therefore pins the real WebAudio listener at the origin (orientation forward = -Z, up = +Y for 2D scenes, identical for every app) and each spatial BaseVoice writes its panner position **relative** to its own system's listener (`source − listener`). Distance, attenuation and the distance model are unaffected: only the offset vector matters to a panner whose listener sits at the origin. A consequence worth knowing: listener motion used to be smoothed once, centrally, on the listener's own `AudioParam`s. It is now folded into each voice's relative position and smoothed per voice by the same SpatialSmoothingSettings. The audible result is the same ramp, but SpatialSmoothingSettings.teleportThreshold is now evaluated against the *relative* jump - a listener warp snaps every voice individually rather than snapping the listener once - and a moving listener costs one `setTargetAtTime` per spatial voice per frame instead of three in total. Owned by AudioSystem; one instance per Application. `velocity` feeds the Doppler calculation on every spatial BaseVoice - explicit when set, else auto-derived each frame from the listener's own position delta (same fallback BaseVoice.velocity uses). That path is unaffected by the virtualization: it has always worked in absolute world coordinates in JS.
import { AudioListener } from '@codexo/exojs'Observer position that spatial voices of one Application are panned against. Read each frame from AudioListener.target when one is set, else written directly via AudioListener.position.
**Virtual, not the WebAudio listener.** `AudioContext.listener` belongs to the process-wide context, so it is a single global object - two Applications writing their own world position into it every frame would simply overwrite each other, and both mixes would pan against whichever ticked last. This class therefore pins the real WebAudio listener at the origin (orientation forward = -Z, up = +Y for 2D scenes, identical for every app) and each spatial BaseVoice writes its panner position **relative** to its own system's listener (`source − listener`). Distance, attenuation and the distance model are unaffected: only the offset vector matters to a panner whose listener sits at the origin.
A consequence worth knowing: listener motion used to be smoothed once, centrally, on the listener's own `AudioParam`s. It is now folded into each voice's relative position and smoothed per voice by the same SpatialSmoothingSettings. The audible result is the same ramp, but SpatialSmoothingSettings.teleportThreshold is now evaluated against the *relative* jump - a listener warp snaps every voice individually rather than snapping the listener once - and a moving listener costs one `setTargetAtTime` per spatial voice per frame instead of three in total.
Owned by AudioSystem; one instance per Application. `velocity` feeds the Doppler calculation on every spatial BaseVoice - explicit when set, else auto-derived each frame from the listener's own position delta (same fallback BaseVoice.velocity uses). That path is unaffected by the virtualization: it has always worked in absolute world coordinates in JS.
destroy(): voidelevation: numberelevationVelocity: number