rodio/examples/music_ogg.rs

16 lines
392 B
Rust
Raw Normal View History

2015-09-10 15:53:00 +00:00
extern crate rodio;
use std::io::BufReader;
2016-10-04 14:36:11 +00:00
use std::thread;
use std::time::Duration;
2015-09-10 15:53:00 +00:00
fn main() {
let endpoint = rodio::get_default_endpoint().unwrap();
2015-10-16 14:37:48 +00:00
let sink = rodio::Sink::new(&endpoint);
2015-09-10 15:53:00 +00:00
let file = std::fs::File::open("examples/music.ogg").unwrap();
2015-10-22 14:45:33 +00:00
sink.append(rodio::Decoder::new(BufReader::new(file)).unwrap());
2015-09-10 15:53:00 +00:00
2016-10-04 14:36:11 +00:00
thread::sleep(Duration::from_millis(60000));
2015-09-10 15:53:00 +00:00
}