Expand description
Audio plugin for the game engine Bevy
It uses the library Kira to play audio and offers an API to control running game audio via Bevy’s ECS.
use bevy_kira_audio::prelude::*;
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(AudioPlugin)
.add_systems(Startup, start_background_audio)
.run();
}
fn start_background_audio(asset_server: Res<AssetServer>, audio: Res<Audio>) {
audio.play(asset_server.load("background_audio.mp3")).looped();
}
Modules§
- prelude
- Most commonly used types
Structs§
- Audio
Channel - Channel to play and control audio
- Audio
Instance - Asset for direct audio control
- Audio
Plugin - A Bevy plugin for audio
- Audio
Settings - This resource is used to configure the audio backend at creation
- Audio
Source - A source of audio data
- Audio
Tween - A tween for audio transitions
- Default
Spatial Radius - Configuration resource for global spatial audio radius
- Dynamic
Audio Channel - A dynamic channel to play and control audio
- Dynamic
Audio Channels - Resource to play and control audio in dynamic channels
- FadeIn
- Marker trait for tween commands that are fading in.
- FadeOut
- Marker trait for tween commands that are fading out.
- Main
Track - Type for the default audio channel
- Play
Audio Command - A command for interacting with playing sound.
- Spatial
Audio Emitter - Component for audio emitters
- Spatial
Audio Plugin - This plugin adds basic spatial audio.
- Spatial
Audio Receiver - Component for the spatial audio receiver.
- Spatial
Radius - Component for per-entity spatial audio radius
- Tween
Command - A command for interacting with the tweening of the playing sound.
Enums§
- Audio
System Set - Labels for audio systems
- Playback
State - Playback status of a currently playing sound.
Traits§
- Audio
App - Extension trait to add new audio channels to the application
- Audio
Control - Play and control audio
- Audio
Instance Assets Ext - Extension trait to remove some boilerplate when
Type Aliases§
- Audio
- The default audio channel
- Audio
Easing - Different kinds of easing for fade-in and fade-out