Last active
May 22, 2017 18:43
-
-
Save siiky/d429fc2f8fc1d8a8e15f46bfed4ce467 to your computer and use it in GitHub Desktop.
Play the Portuguese phonemes with espeak-ng
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env run-cargo-script | |
use std::process::Command; | |
use std::thread::sleep; | |
use std::time::Duration; | |
fn main() { | |
let phonemes: Vec<&str> = vec!["[[&]]", "[[&/]]", "[[a]]", "[[&~]]", "[[&U~]]", "[[E]]", | |
"[[e]]", "[[y]]", "[[i]]", "[[i/]]", "[[O]]", "[[o]]", "[[u]]", | |
"[[U]]", "[[EU]]", "[[w]]", "[[x]]", "[[R]]", "[[s#]]"]; | |
let aux = |s, p| format!("failed to {} proc with phoneme {}", s, p); | |
for ph in phonemes { | |
let spawnmsg = aux("exec", ph); | |
let waitmsg = aux("wait for", ph); | |
let _ = Command::new("espeak-ng") | |
.arg("-vpt-pt") | |
.arg(ph) | |
.spawn() | |
.expect(spawnmsg.as_str()) | |
.wait() | |
.expect(waitmsg.as_str()); | |
sleep(Duration::from_millis(500)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment