1use soloud::*;
2
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let mut sl = Soloud::default()?;
5 sl.set_global_volume(4.0);
6
7 let mut speech = audio::Speech::default();
8
9 speech.set_text("Hello World")?;
10
11 sl.play(&speech);
12 while sl.active_voice_count() > 0 {
13 std::thread::sleep(std::time::Duration::from_millis(100));
14 }
15
16 speech.set_text("1 2 3")?;
17
18 sl.play(&speech);
19 while sl.active_voice_count() > 0 {
20 std::thread::sleep(std::time::Duration::from_millis(100));
21 }
22
23 speech.set_text("Can you hear me?")?;
24
25 sl.play(&speech);
26 while sl.active_voice_count() > 0 {
27 std::thread::sleep(std::time::Duration::from_millis(100));
28 }
29
30 Ok(())
31}