Crate bevy::audio

Expand description

Audio support for the game engine Bevy

fn main() {
        .add_plugins((MinimalPlugins, AssetPlugin::default(), AudioPlugin::default()))
        .add_systems(Startup, play_background_audio)

fn play_background_audio(asset_server: Res<AssetServer>, mut commands: Commands) {
    commands.spawn(AudioBundle {
        source: asset_server.load("background_audio.ogg"),
        settings: PlaybackSettings::LOOP,





  • A trait that allows adding a custom audio source to the object. This is implemented for App to allow registering custom Decodable types.
  • Common interactions with an audio sink.
  • A trait for working generically across different Sample format types.
  • A type implementing this trait can be converted to a rodio::Source type. It must be Send and Sync in order to be registered. Types that implement this trait usually contain raw sound data that can be converted into an iterator of samples. This trait is implemented for AudioSource. Check the example decodable for how to implement this trait on a custom type.
  • Represents a value of a single sample.
  • A source of samples.

Type Aliases§