Trait bevy::audio::AddAudioSource

pub trait AddAudioSource {
    // Required method
    fn add_audio_source<T>(&mut self) -> &mut Self
       where T: Decodable + Asset,
             f32: FromSample<<T as Decodable>::DecoderItem>;
}
Expand description

A trait that allows adding a custom audio source to the object. This is implemented for App to allow registering custom Decodable types.

Required Methods§

fn add_audio_source<T>(&mut self) -> &mut Self
where T: Decodable + Asset, f32: FromSample<<T as Decodable>::DecoderItem>,

Registers an audio source. The type must implement Decodable, so that it can be converted to a rodio::Source type, and Asset, so that it can be registered as an asset. To use this method on App, the audio and asset plugins must be added first.

Object Safety§

This trait is not object safe.

Implementors§