mirror of
https://github.com/RustAudio/rodio
synced 2025-03-02 22:17:16 +00:00
Expand basic example with printlns
This commit is contained in:
parent
350fae9dab
commit
a29ad630f2
1 changed files with 10 additions and 5 deletions
|
@ -10,21 +10,26 @@ fn main() {
|
|||
let file = std::fs::File::open("examples/beep.wav").unwrap();
|
||||
let mut beep1 = rodio::play_once(&endpoint, BufReader::new(file)).unwrap();
|
||||
beep1.set_volume(0.2);
|
||||
println!("Started beep1");
|
||||
|
||||
thread::sleep(Duration::from_millis(1000));
|
||||
thread::sleep(Duration::from_millis(1500));
|
||||
|
||||
let file = std::fs::File::open("examples/beep2.wav").unwrap();
|
||||
rodio::play_once(&endpoint, BufReader::new(file)).unwrap().detach();
|
||||
println!("Started beep2");
|
||||
|
||||
thread::sleep(Duration::from_millis(1000));
|
||||
thread::sleep(Duration::from_millis(1500));
|
||||
let file = std::fs::File::open("examples/beep3.ogg").unwrap();
|
||||
let beep3 = rodio::play_once(&endpoint, file).unwrap();
|
||||
println!("Started beep3");
|
||||
|
||||
thread::sleep(Duration::from_millis(1000));
|
||||
thread::sleep(Duration::from_millis(1500));
|
||||
drop(beep1);
|
||||
println!("Stopped beep1");
|
||||
|
||||
thread::sleep(Duration::from_millis(1000));
|
||||
thread::sleep(Duration::from_millis(1500));
|
||||
drop(beep3);
|
||||
println!("Stopped beep3");
|
||||
|
||||
thread::sleep(Duration::from_millis(1000));
|
||||
thread::sleep(Duration::from_millis(1500));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue