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§
- Spatial
Emitter - 3D Spatial Sound Emitter.
- Spatial
Listener - 3D Spatial Listener (camera or avatar ears).
- Spatial
Occlusion Bridge - Acoustic occlusion bridge parameters for SDF/BVH ray-marched scene audio graphs.
- Spatial
Occlusion Filter State - Zero-heap stereo DF2T biquad state for per-voice occlusion low-pass filtering.
- Spatial
Voice Params - Computed spatial voice parameters for audio buffer rendering.
Enums§
- Distance
Model - 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.