devela::_dep::kira::sound

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§

Traits§