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
type Error
Errors that can occur when starting the sound.
type Handle
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> ⓘ
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
.