1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
use std::process::Command; /// Speaks a string pub fn speak(string: &str) { let _ = Command::new("espeak") .arg("-p 30") .arg("-s 165") .arg("-g 3") .arg("-ven-sc") .arg(string) .output() .expect("espeak must be installed!"); } /// Speaks a string asyncronously pub fn speak_async(string: &str) { let _ = Command::new("espeak") .arg("-p 30") .arg("-s 165") .arg("-g 3") .arg("-ven-sc") .arg(string) .spawn() .expect("espeak must be installed!"); }