Skip to main content

Module spatial

Module spatial 

Source
Expand description

Zero-Heap 3D Spatial Audio & Doppler Engine (spatial.rs)

Provides deterministic 3D spatial sound processing delegated to [etalon_signal::spatial]:

  • Distance attenuation models (Inverse, Linear, Exponential)
  • Directional emission cones (inner angle, outer angle, outer attenuation)
  • Doppler frequency pitch shifting based on relative emitter-listener velocities
  • Equal-power stereo binaural panning and interaural level/time differences
  • Caller-buffered zero-heap mixing

Designed according to AGENTS.md §0 (Zero heap in hot paths).

Structs§

SpatialEmitter
3D Spatial Sound Emitter.
SpatialListener
3D Spatial Listener (camera or avatar ears).
SpatialOcclusionBridge
Acoustic occlusion bridge parameters for SDF/BVH ray-marched scene audio graphs.
SpatialOcclusionFilterState
Zero-heap stereo DF2T biquad state for per-voice occlusion low-pass filtering.
SpatialVoiceParams
Computed spatial voice parameters for audio buffer rendering.

Enums§

DistanceModel
Distance attenuation model.

Constants§

MAX_SPATIAL_VOICES
Maximum spatial sound emitters processed in a single zero-heap mix pass.
SPEED_OF_SOUND_AIR
Speed of sound in dry air at 20°C in m/s.

Functions§

mix_spatial_voice_into
Zero-heap stereo mixer mixing mono PCM audio into a stereo output buffer with spatial gains.
mix_spatial_voice_occluded_into
Zero-heap occluded stereo mixer with DF2T biquad low-pass occlusion filtering and wet reverb send bus accumulation.