API reference

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

I

interfaceSpatialSmoothingSettings

@codexo/exojs / audio / stable

Tunable smoothing settings shared by the listener and all spatial voices. Owned by AudioSystem and reachable as `app.audio.spatial`.

7
props
0
methods
0
events
Import
import { SpatialSmoothingSettings } from '@codexo/exojs'

Tunable smoothing settings shared by the listener and all spatial voices. Owned by AudioSystem and reachable as `app.audio.spatial`.

Properties7
dopplerFactor: number
Doppler pitch-shift strength multiplier. 0 (default) disables Doppler entirely - even when velocity data is available on a voice or the listener, no playbackRate modulation is applied unless this is set above zero. 1 is physically scaled (relative to speedOfSound); many games deliberately exaggerate beyond 1 for player feedback.
occlusionAttenuation: number
Linear gain a voice at Spatializable.occlusion 1 is attenuated to. Default DEFAULT_OCCLUSION_ATTENUATION. Not 0: a fully occluded source that goes silent reads as a bug rather than as an obstruction.
occlusionCutoff: number
Lowpass cutoff (Hz) a voice at Spatializable.occlusion 1 is filtered to. Default DEFAULT_OCCLUSION_CUTOFF (400 Hz) - roughly "behind a closed door". Interpolation between clear and fully occluded is logarithmic, matching how pitch is perceived.
panningModel: PanningModelType
App-wide default panning model for every spatial voice that doesn't set its own Spatializable.panningModel override. 'equalpower' (cheap, works on any speaker setup) or 'HRTF' (binaural, meaningfully more CPU-expensive per voice, only sounds convincingly directional through headphones). Default 'equalpower'.
smoothing: number
Time constant (seconds) passed to setTargetAtTime when ramping a moving position toward its target. 0 (or negative) disables ramping - positions snap each frame. Default DEFAULT_SPATIAL_SMOOTHING (20 ms).
speedOfSound: number
Reference speed (world units per second) used to scale the Doppler effect. World units have no fixed physical scale across different games (pixels, meters, tiles), so this is a tunable, not a physical constant - pick a value where your game's typical emitter/listener speeds produce a noticeable but not extreme shift.
teleportThreshold: number
Position jump (world units) treated as a teleport: the param snaps with setValueAtTime instead of ramping. Default DEFAULT_TELEPORT_THRESHOLD. Measured on the **source-to-listener offset**, not on either absolute position - voices are panned relative to their own application's AudioListener, which is virtual. Practically: warping the listener is a teleport for every spatial voice at once (each snaps its own panner), and a source that warps *together with* the listener does not cross the threshold at all, because its offset never changed.
Source