Trait riddle_audio::ext::AudioSystemExt[][src]

pub trait AudioSystemExt {
    fn new_shared(
    ) -> Result<(AudioSystemHandle, AudioMainThreadState), AudioError>;
fn process_frame(&self); }

Required methods

fn new_shared() -> Result<(AudioSystemHandle, AudioMainThreadState), AudioError>[src]

Create the audio system, connected to the default audio output device.

fn process_frame(&self)[src]

Update the system’s state.

Updates all ClipPlayer fades. This must be called periodically for the AudioSystem to function. Do not call this if the riddle crate is being used.

Example

let (audio_system, _audio_main_thread_state) = AudioSystem::new_shared()?;

// Tick the audio system every 100ms
let start_time = std::time::Instant::now();
while std::time::Instant::now() - start_time < std::time::Duration::from_secs(2) {
    audio_system.process_frame();
    std::thread::sleep(std::time::Duration::from_millis(100));
}
Loading content...

Implementors

impl AudioSystemExt for AudioSystem[src]

Loading content...