rodio/examples/music_flac.rs

12 lines
332 B
Rust
Raw Normal View History

2017-02-09 10:49:44 +00:00
use std::io::BufReader;
fn main() {
2020-02-25 10:09:17 +00:00
let (_stream, handle) = rodio::OutputStream::try_default().unwrap();
let sink = rodio::Sink::try_new(&handle).unwrap();
2017-02-09 10:49:44 +00:00
let file = std::fs::File::open("assets/music.flac").unwrap();
2017-02-09 10:49:44 +00:00
sink.append(rodio::Decoder::new(BufReader::new(file)).unwrap());
sink.sleep_until_end();
}