9 breaking releases

0.35.0 May 23, 2024
0.34.0 Jan 25, 2024
0.33.0 Oct 26, 2023
0.32.0 Jul 22, 2023
0.26.0 Jan 10, 2022

#409 in Audio

Download history 84/week @ 2024-08-03 84/week @ 2024-08-10 62/week @ 2024-08-17 68/week @ 2024-08-24 80/week @ 2024-08-31 102/week @ 2024-09-07 88/week @ 2024-09-14 139/week @ 2024-09-21 103/week @ 2024-09-28 69/week @ 2024-10-05 96/week @ 2024-10-12 91/week @ 2024-10-19 95/week @ 2024-10-26 143/week @ 2024-11-02 93/week @ 2024-11-09 85/week @ 2024-11-16

428 downloads per month
Used in 6 crates (via fyrox-impl)

MIT license

2MB
16K SLoC

fyrox-sound

Sound library for games and interactive applications written in Rust.

NOTE: even though this crate has fyrox prefix in its name, it can be used separately without any issues.

Key features

  • Generic and Spatial sound sources.
  • Built-in streaming for large sounds.
  • Raw samples playback support.
  • WAV format support (non-compressed).
  • Vorbis/ogg support (using lewton).
  • HRTF support for excellent positioning and binaural effects.
  • Reverb 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)
  • macOS (CoreAudio)
  • WebAssembly (WebAudio)
  • Android (AAudio, API Level 26+)

HRTF

This library has full HRTF support, it uses HRIR spheres generated using IRCAM HRIR database. HRIR spheres are produced using a small tool written in C++ - hrir_sphere_builder. It is very important to find HRTF that suits you because they're very individual and the overall perception is fully defined by the use of correct HRTF.

Contributions

Any contributions are very appreciated! Check the Issues page to see how can you help the project.

License

MIT

References

This library wouldn't have been ever created without work of these people. Thank you all!

  1. Digital signal processing and filters
  2. Physical Audio Signal Processing
  3. 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
  4. Fábio P. Freeland, Luiz W. P. Biscainho, Paulo S. R. Diniz, "Interpolation of Head-related transfer function (HRTFS): A Multi-source approarch"
  5. IRCAM Head-related impulse response database
  6. Reverb
  7. Overlap-add convolution - not used anymore due to significant distortions at segment boundary when impulse response changes.
  8. Overlap-save convolution - works much better when impulse response changes, there are only phase shift issues which are more or less acceptable.
  9. OpenAL Specification - distance models and general design considerations.
  10. http://csoundjournal.com/issue9/newHRTFOpcodes.html - some ideas to remove clicks in hrtf renderer
  11. https://phaidra.kug.ac.at/open/o:11024

Dependencies

~12–23MB
~367K SLoC