rodio/examples/music_wav.rs

12 lines
309 B
Rust
Raw Normal View History

2015-09-10 14:38:16 +00:00
use std::io::BufReader;
2015-09-01 17:35:26 +00:00
fn main() {
let stream = rodio::OutputStream::try_default().unwrap();
let sink = rodio::Sink::new(&stream);
2015-09-01 17:35:26 +00:00
let file = std::fs::File::open("examples/music.wav").unwrap();
2015-10-22 14:45:33 +00:00
sink.append(rodio::Decoder::new(BufReader::new(file)).unwrap());
2015-09-01 17:35:26 +00:00
2015-10-16 14:37:48 +00:00
sink.sleep_until_end();
2015-09-01 17:35:26 +00:00
}