rusty_audio 1.4.1

Convenient sound library for small projects and educational purposes.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use rusty_audio::Audio;

fn main() {
    // Create a 4-channel audio subsystem.
    let mut audio = Audio::new();
    // On systems without an audio card, Audio will run in disabled mode, which doesn't do anything,
    // but at least doesn't crash.  Helpful for CI.
    if audio.disabled() {
        println!("Sorry, we couldn't find an audio device, so no sound will play for you. :'-(");
    }
    audio.add("startup", "audio_subsystem_initialized.mp3"); // Load the sound, give it a name
    audio.play("startup"); // Execution continues while playback occurs in another thread.
    audio.wait(); // Block until sounds finish playing
}