Expand description
Spatial audio — position-based stereo panning, distance attenuation, and per-room reverb.
Maps entity world positions to stereo pan and volume. Provides room-type reverb presets (tight combat, long boss, cathedral shrine). All sounds can be positioned in the 2D arena for immersive audio.
§Panning model
Uses a linear stereo pan where X position maps to left/right:
- X < 0 → more left channel
- X > 0 → more right channel
- X = 0 → center
§Distance attenuation
Inverse-distance model with configurable reference distance and rolloff.
Sounds beyond max_distance are silent.
§Reverb
Simple Schroeder reverb with 4 comb filters + 2 allpass filters. Room presets configure delay lengths, feedback, and mix.
Structs§
- Distance
Model - Distance attenuation model.
- Reverb
Params - Reverb parameters.
- Spatial
Audio System - Manages spatial audio: positioned sounds, distance attenuation, and reverb.
- Spatial
Reverb - Schroeder reverb: 4 parallel comb filters → 2 series allpass filters.
- Spatial
Sound - A sound source with a position in the arena.
- Stereo
Pan - Stereo pan result: gain for left and right channels.
Enums§
- Room
Type - Room type for reverb preset selection.
- Sound
Origin - Origin of a sound in the game world.