rodio/examples/music_ogg.rs

14 lines
326 B
Rust
Raw Normal View History

2015-09-10 15:53:00 +00:00
extern crate rodio;
use std::io::BufReader;
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-16 14:37:48 +00:00
sink.append(rodio::Decoder::new(BufReader::new(file)));
2015-09-10 15:53:00 +00:00
std::thread::sleep_ms(60000);
}