Crate bevy_audio

Source
Expand description

Audio support for the game engine Bevy

fn main() {
   App::new()
        .add_plugins((MinimalPlugins, AssetPlugin::default(), AudioPlugin::default()))
        .add_systems(Startup, play_background_audio)
        .run();
}

fn play_background_audio(asset_server: Res<AssetServer>, mut commands: Commands) {
    commands.spawn((
        AudioPlayer::new(asset_server.load("background_audio.ogg")),
        PlaybackSettings::LOOP,
    ));
}

Modules§

Structs§

Enums§

Traits§

  • 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.
  • Represents a value of a single sample.
  • A source of samples.

Type Aliases§

  • AudioBundleDeprecated
    Bundle for playing a standard bevy audio asset
  • PitchBundleDeprecated
    Bundle for playing a bevy note sound