Skip to content

Bevy integration for the phonon_rs spatial audio library

License

Notifications You must be signed in to change notification settings

GitGhillie/bevy_phonon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bevy Phonon

A bevy integration for the unofficial Steam Audio Rust port, phonon_rs.
Demo: https://youtu.be/DFIYmiytqAw TODO: Update demo with HRTF and transmission.

As phonon_rs is game engine and audio engine independent, a choice must be made for the audio engine. Currently only FMOD is supported (through bevy_fmod specifically). Kira support is possible, pending the following issue.

⚠️ Warning: I don't know yet how this crate will fare in real projects (especially compared to Steam Audio). If you have any data/issues in this regard, please consider contributing or contacting me through Discord (user: ixml). If it's working well for you I'd also like to hear that!

Features

  • Panning Effect (stereo only for now)
  • Binaural Effect (built-in HRTF only for now)
  • Direct Effect
    • Distance attenuation
    • Air absorption
    • Occlusion
    • Transmission (one material per mesh for now)
    • Directivity

FMOD Phonon Spatializer

Planned: Geometry-based reverb (CPU/GPU), baking and more.

Usage

  1. First follow the setup of bevy_fmod.
  2. Clone https://github.com/GitGhillie/phonon_rs and build the FMOD plugin using cargo build -p phonon-fmod --release.
  3. Place the FMOD plugin into one of the FMOD plugin directories.
  4. Copy phonon_fmod.plugin.js to the plugin directory. TODO add link.
  5. In FMOD Studio you can now add the Phonon Spatializer effect to your event tracks: FMOD Plugin Selection
  6. On the Bevy side update FmodPlugin to include the path to the FMOD plugin, and add the PhononPlugin:
    .add_plugins((
        DefaultPlugins,
        FmodPlugin {
            audio_banks_paths: &[
                "./assets/fmod-project/Build/Desktop/Master.bank",
                "./assets/fmod-project/Build/Desktop/Master.strings.bank",
                "./assets/fmod-project/Build/Desktop/Music.bank",
            ],
            plugin_paths: Some(&["./assets/fmod-project/Plugins/libphonon_fmod.so"]),
        },
    ))
    .add_plugins(PhononPlugin::default())

License

Licensed under Apache-2.0

About

Bevy integration for the phonon_rs spatial audio library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages