How to play audio

So I was wondering if anyone knows any good rust audio libraries I tried to get rodio to work but it was not working for me (it just would not play and I did not get any errors)

and if I was dumb

    // Get a output stream handle to the default physical sound device
    let (_stream, stream_handle) = OutputStream::try_default().unwrap();
    // Load a sound from a file, using a path relative to Cargo.toml
    let file = BufReader::new(File::open("doom.ogg").unwrap());
    // Decode that sound file into a source
    let source = Decoder::new(file).unwrap();
    // Play the sound directly on the device
    stream_handle.play_raw(source.convert_samples());
    
    // The sound plays in a separate audio thread,
    // so we need to keep the main thread alive while it's playing.
    std::thread::sleep(std::time::Duration::from_secs(5));

I am just doing Command::new and using cvlc

You could also look at rodio and avoid using a command (that may not exist on the target machine).
Oops. you already tried that.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.