Bevy Kira audio

Crates.io docs license Crates.io

This bevy plugin is intended to try integrating Kira into Bevy. The goal is to replace or update bevy_audio, if Kira turns out to be a good approach. Currently, this plugin can play ogg, mp3, flac, and wav formats and supports web builds for everything except mp3. It also supports streaming of generated audio.

You can check out the examples directory in this repository for a display of this plugin's functionality.

Usage

To initialize the corresponding AssetLoaders, use at least one of the features ogg, mp3, wav, or flac. The following example assumes that the feature bevy_kira_audio/ogg is enabled.

```rust use bevykiraaudio::{AudioChannel, Audio, AudioPlugin}; use bevy::prelude::*;

fn main() { let mut app = App::build(); app .addplugins(DefaultPlugins) .addplugin(AudioPlugin) .addstartupsystem(startbackgroundaudio.system()); app.run(); }

fn startbackgroundaudio(assetserver: Res, audio: Reslooped(assetserver.load("backgroundaudio.ogg")); } ```

Current state

Compatible Bevy versions

The main branch is up to date with the latest Bevy release. The branch bevy_main tracks the main branch of Bevy.

Compatibility of published bevy_kira_audio versions: | bevy_kira_audio | bevy | | :-- | :-- | | 0.4.0 - 0.5.0 | 0.5.0 | | 0.3.0 | 0.4.0 |

License

This crate is distributed under the terms of the MIT license.

Assets in the examples might be distributed under different terms. See the readme in the examples directory.