rg3d-sound
Sound library for games written in Rust with HRTF support.
Key features
- Spatial and flat sounds
- Built-in streaming for large sounds
- WAV format support (non-compressed)
- Vorbis/ogg support (using lewton)
- HRTF support for excellent positioning and binaural effects.
- Reberb effect
Examples
Examples can be found in ./examples
Make sure you run examples with --release
flag, debug
version is very slow and may cause tearing of output sound.
Supported OS
- Windows (DirectSound)
- Linux (alsa)
How to build
Add rg3d-sound = "0.7.0"
to your Cargo.toml
Supported Rust version is >= 1.38
HRTF
Library has full HRTF support, it uses HRIR spheres generated using IRCAM HRIR database. HRIR spheres are produced using small tool written in C++ - hrir_sphere_builder
Help needed
It would be great if someone make backend for macOS.
License
MIT
References
- Digital signal processing and filters
- Physical Audio Signal Processing
- Hannes Gamper, "Head-related transfer function interpolation in azimuth, elevation, and distance", The Journal of the Acoustical Society of America 134, EL547 (2013); doi: 10.1121/1.4828983
- Fábio P. Freeland, Luiz W. P. Biscainho, Paulo S. R. Diniz, "Interpolation of Head-related transfer function (HRTFS): A Multi-source approarch"
- IRCAM Head-related impulse response database
- Reverb
- Overlap-add convolution - not used anymore due to significant distortions at segment boundary when impulse response changes.
- Overlap-save convolution - works much better when impulse response changes, there are only phase shift issues which are more less acceptable.
- OpenAL Specification - distance models and general design considerations.
- http://csoundjournal.com/issue9/newHRTFOpcodes.html - some ideas to remove clicks in hrtf renderer
- https://phaidra.kug.ac.at/open/o:11024