Crate bevy_kira_audio

Crate bevy_kira_audio 

Source
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§

AudioChannel
Channel to play and control audio
AudioInstance
Asset for direct audio control
AudioPlugin
A Bevy plugin for audio
AudioSettings
This resource is used to configure the audio backend at creation
AudioSource
A source of audio data
AudioTween
A tween for audio transitions
DefaultSpatialRadius
Configuration resource for global spatial audio radius
DynamicAudioChannel
A dynamic channel to play and control audio
DynamicAudioChannels
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.
MainTrack
Type for the default audio channel
PlayAudioCommand
A command for interacting with playing sound.
SpatialAudioEmitter
Component for audio emitters
SpatialAudioPlugin
This plugin adds basic spatial audio.
SpatialAudioReceiver
Component for the spatial audio receiver.
SpatialRadius
Component for per-entity spatial audio radius
TweenCommand
A command for interacting with the tweening of the playing sound.

Enums§

AudioSystemSet
Labels for audio systems
PlaybackState
Playback status of a currently playing sound.

Traits§

AudioApp
Extension trait to add new audio channels to the application
AudioControl
Play and control audio
AudioInstanceAssetsExt
Extension trait to remove some boilerplate when

Type Aliases§

Audio
The default audio channel
AudioEasing
Different kinds of easing for fade-in and fade-out