devela::_dep::kira::sound

Trait SoundData

pub trait SoundData {
    type Error;
    type Handle;

    // Required method
    fn into_sound(self) -> Result<(Box<dyn Sound>, Self::Handle), Self::Error> ;
}
Available on crate feature dep_kira only.
Expand description

A source of audio that is loaded, but not yet playing.

Required Associated Types§

type Error

Errors that can occur when starting the sound.

type Handle

The type that can be used to control the sound once it has started.

Required Methods§

fn into_sound(self) -> Result<(Box<dyn Sound>, Self::Handle), Self::Error>

Converts the loaded sound into a live, playing sound and a handle to control it.

The Sound implementation will be sent to the audio renderer for playback, and the handle will be returned to the user by AudioManager::play.

Implementors§

§

impl SoundData for StaticSoundData

§

impl<Error> SoundData for StreamingSoundData<Error>
where Error: Send + 'static,

§

type Error = Error

§

type Handle = StreamingSoundHandle<Error>