Expand description
micro_musicbox provides a convenience wrapper around bevy_kira_audio, handling all the setup for the common game audio scenario. This includes channel management, giving you control of the audio levels for your music, ambiance, sound effects and UI separately from the start.
§Quickstart
- Implement
SuppliesAudiofor a resource (or use the built-in impl onAssetServer) - Include the MusixBocPlugin plugin, or the CombinedAudioPlugins plugin group in your app, providing your
SuppliesAudioimpl as the generic parameter - Use
MusicBox<T: SuppliesAudio>as a parameter on a system - Call one of the
MusicBox::play_*methods to play sounds
fn main() {
App::new()
.add_plugins(AssetPlugin::default())
.add_plugins(CombinedAudioPlugins::<AssetServer>::new())
.add_systems(Startup, |mut music_box: MusicBox<AssetServer>| {
music_box.play_music("music/bing_bong.mp3");
});
}Modules§
Structs§
- Combined
Audio Plugins - A Bevy plugin group that adds
bevy_kira_audioas well as the plugin required to be able to use aMusicBox - Music
BoxPlugin - A Bevy plugin that sets up all of the audio channels,
creates the required settings resources, and configures
syncing volume levels for a
MusicBoxthat uses the suppliedTparameter for fetching audio