rodio/examples/music_wav.rs

13 lines
290 B
Rust
Raw Normal View History

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() {
let endpoint = rodio::get_default_endpoint().unwrap();
let file = std::fs::File::open("examples/music.wav").unwrap();
2015-09-10 14:38:16 +00:00
let _music = rodio::play_once(&endpoint, BufReader::new(file));
2015-09-01 17:35:26 +00:00
std::thread::sleep_ms(10000);
}