Module streaming
Available on crate feature
dep_kira
only.Expand description
Decodes data gradually from an audio file.
To play a streaming sound, pass a StreamingSoundData
to
AudioManager::play
.
use kira::{
AudioManager, AudioManagerSettings, DefaultBackend,
sound::streaming::{StreamingSoundData, StreamingSoundSettings},
};
let mut manager = AudioManager::<DefaultBackend>::new(AudioManagerSettings::default())?;
let sound_data = StreamingSoundData::from_file("sound.ogg")?;
manager.play(sound_data)?;
Streaming sounds use less memory than static sounds, but they use more CPU, and they can have delays when starting or seeking.
Structs§
- Streaming
Sound Data - A streaming sound that is not playing yet.
- Streaming
Sound Handle - Controls a streaming sound.
- Streaming
Sound Settings - Settings for a streaming sound.
Traits§
- Decoder
- Decodes chunks of audio.