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§
- The audio prelude.
Structs§
- Loads files as
AudioSourceAssets - A component for playing a sound.
- Adds support for audio playback to a Bevy Application
- Used to control audio during playback.
- A source of audio data
- Audio
Source Bundle Deprecated Bundle for playing a sound. - The default scale factor applied to the positions of audio sources and listeners for spatial audio. Can be overridden for individual sounds in
PlaybackSettings. - Use this
Resourceto control the global volume of all audio. - A source of sine wave sound
- Initial settings to be used when audio starts playing.
- Used to control spatial audio during playback.
- Settings for the listener for spatial audio sources.
- A scale factor applied to the positions of audio sources and listeners for spatial audio.
- A volume level equivalent to a non-negative float.
Enums§
- The way Bevy manages the sound playback.
Traits§
- 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::Sourcetype. - Represents a value of a single sample.
- A source of samples.
Type Aliases§
- Audio
Bundle Deprecated Bundle for playing a standard bevy audio asset - Pitch
Bundle Deprecated Bundle for playing a bevy note sound