Trait bevy_kira_components::sources::AudioSource
source · pub trait AudioSource: Asset {
type Error: Display;
type Handle: 'static + Send + Sync;
type Settings: Send + Sync + Default + Component;
// Required method
fn create_handle(
&self,
manager: &mut AudioManager<AudioBackend>,
settings: &Self::Settings,
output_destination: OutputDestination
) -> Result<Self::Handle, Self::Error>;
}
Expand description
Trait for implementing an audio source to play in the audio engine.
The audio source needs to provide two things:
- An implementation of [
kira::sound::Sound
] which is going to be sent to the audio engine to generate audio samples - A handle which sets up communication between the aforementioned sound and the rest of the world.
The trait supports a Settings
struct, which allows users to customize the sound that will
be sent before its creation.
Required Associated Types§
sourcetype Error: Display
type Error: Display
Error type that encompasses possible errors that can happen when creating the audio source
Required Methods§
Object Safety§
This trait is not object safe.