API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classSpatialZones
The optional zone layer: which AudioZones exist, and the sends they currently hold open. Owned by AudioSystem and reachable as `app.audio.zones`. Completely inert until a zone is added - the per-frame tick returns immediately, so an application that never uses zones pays one branch. Once a zone exists, each frame: 1. every zone's weight is sampled at the LISTENER's position, because that is where an environment is heard from; 2. every audible spatial voice gets one send per zone whose weight is above zero, at `weight * zone.send`. A voice with no position in the world - a UI blip, a music bed - is never given a zone send: it is not being heard from anywhere in particular; 3. a send whose zone has faded out, or whose voice has ended or stopped being positional, is dropped. Sends are opened lazily and reused across frames, so walking into a zone costs one `GainNode` per voice and then nothing per frame but a level write - and the level is ramped, so the boundary is a crossfade rather than a switch. The zone layer never owns a bus or an effect. A zone names a bus the caller built; what that bus does - a convolution reverb, a lowpass, a pitch shift - is entirely the caller's, and two zones may legitimately name the same one.
import { SpatialZones } from '@codexo/exojs'The optional zone layer: which AudioZones exist, and the sends they currently hold open.
Owned by AudioSystem and reachable as `app.audio.zones`. Completely inert until a zone is added - the per-frame tick returns immediately, so an application that never uses zones pays one branch.
Once a zone exists, each frame:
1. every zone's weight is sampled at the LISTENER's position, because that is where an environment is heard from; 2. every audible spatial voice gets one send per zone whose weight is above zero, at `weight * zone.send`. A voice with no position in the world - a UI blip, a music bed - is never given a zone send: it is not being heard from anywhere in particular; 3. a send whose zone has faded out, or whose voice has ended or stopped being positional, is dropped.
Sends are opened lazily and reused across frames, so walking into a zone costs one `GainNode` per voice and then nothing per frame but a level write - and the level is ramped, so the boundary is a crossfade rather than a switch.
The zone layer never owns a bus or an effect. A zone names a bus the caller built; what that bus does - a convolution reverb, a lowpass, a pitch shift - is entirely the caller's, and two zones may legitimately name the same one.
new(): SpatialZonesclear(): thisactive: boolean