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() {
2018-04-18 19:23:40 +00:00
let device = rodio::default_output_device().unwrap();
let sink = rodio::Sink::new(&device);
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
2017-02-09 10:49:44 +00:00
sink.sleep_until_end();
2015-09-10 15:53:00 +00:00
}