API reference

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

C

classAudioZone

@codexo/exojs / audio / stable

A region of the world that contributes a parallel send while the listener is inside it - a reverb zone, a muffled corridor, an underwater section. The zone owns geometry and a level, and nothing else: it does not route audio, hold effects or touch a voice. SpatialZones reads AudioZone.weightAt once per frame and maintains the sends. That split is deliberate - it means a zone is a plain value a level file can describe, and the effect chain behind it is an ordinary AudioBus the caller already knows how to build. Reverb belongs to the environment the LISTENER is in, not to each source, which is why the weight is sampled at the listener and applied to every audible spatial voice.

6
props
1
methods
0
events
Import
import { AudioZone } from '@codexo/exojs'

A region of the world that contributes a parallel send while the listener is inside it - a reverb zone, a muffled corridor, an underwater section.

The zone owns geometry and a level, and nothing else: it does not route audio, hold effects or touch a voice. SpatialZones reads AudioZone.weightAt once per frame and maintains the sends. That split is deliberate - it means a zone is a plain value a level file can describe, and the effect chain behind it is an ordinary AudioBus the caller already knows how to build.

Reverb belongs to the environment the LISTENER is in, not to each source, which is why the weight is sampled at the listener and applied to every audible spatial voice.

Constructors1
new(__namedParameters: AudioZoneOptionsConstruction options for AudioZone.): AudioZone
Methods1
weightAt(x: number, y: number, z: number): number
How strongly this zone applies at (x, y, z): 1 inside the shape, 0 beyond AudioZone.falloff, and a linear ramp between. The ramp is measured on the distance to the shape's boundary rather than to its centre, so a long corridor fades over the same distance at its middle as at its ends. A z beyond AudioZone.height is outside the zone regardless of (x, y).
Properties6
falloff: number
Distance outside the shape over which the weight ramps from 1 to 0.
height: number
How far the zone reaches above and below the world plane; 100 covers z from -100 to 100.
name: string
send: number
Send level at full weight.
Source