2015-09-01 17:35:26 +00:00
|
|
|
extern crate rodio;
|
|
|
|
|
2015-09-10 14:38:16 +00:00
|
|
|
use std::io::BufReader;
|
|
|
|
|
2015-09-01 17:35:26 +00:00
|
|
|
fn main() {
|
2017-10-11 13:31:15 +00:00
|
|
|
let endpoint = rodio::default_endpoint().unwrap();
|
2015-10-16 14:37:48 +00:00
|
|
|
let sink = rodio::Sink::new(&endpoint);
|
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
|
|
|
}
|