Module static_sound
Available on crate feature
dep_kira
only.Expand description
Playable chunks of audio that are loaded into memory all at once.
To play a static sound, pass a StaticSoundData
to
AudioManager::play
.
use kira::{
AudioManager, AudioManagerSettings, DefaultBackend,
sound::static_sound::{StaticSoundData, StaticSoundSettings},
};
let mut manager = AudioManager::<DefaultBackend>::new(AudioManagerSettings::default())?;
let sound_data = StaticSoundData::from_file("sound.ogg")?;
manager.play(sound_data)?;
Compared to streaming sounds, static sounds have lower CPU usage and shorter delays when starting and seeking, but they use a lot more memory.
Structsยง
- A piece of audio loaded into memory all at once.
- Controls a static sound.
- Settings for a static sound.