summaryrefslogtreecommitdiff
path: root/tools/voice.pl
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-07-11 11:21:26 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-07-11 17:22:06 +0000
commitb546d9d172bfca7f050e40244cd5d6f0fbd96c90 (patch)
tree0d1e647fca11ef031010ba3dc3ddecf236af089f /tools/voice.pl
parentaad57ea1cc59144475cc80538523121d97b293d4 (diff)
voice: More fixes, and add more languages
* Pass strings via stdin where possible * Add German, Italian, and Norweigan to the build list. (in other words, everything with >=95% coverage) Change-Id: I0154b178b15ddd0b79566c1cb62f76ade32824aa
Diffstat (limited to 'tools/voice.pl')
-rwxr-xr-xtools/voice.pl26
1 files changed, 17 insertions, 9 deletions
diff --git a/tools/voice.pl b/tools/voice.pl
index 0b49ddff04..9bb94c9c6e 100755
--- a/tools/voice.pl
+++ b/tools/voice.pl
@@ -164,7 +164,7 @@ sub init_tts {
if (defined($gtts_lang_map{$language}) && $tts_engine_opts !~ /-l/) {
$ret{"ttsoptions"} = "-l $gtts_lang_map{$language} ";
}
- } elsif ($tts_engine eq 'espeak') {
+ } elsif ($tts_engine eq 'espeak' || $tts_engine eq 'espeak-ng') {
if (defined($espeak_lang_map{$language}) && $tts_engine_opts !~ /-v/) {
$ret{"ttsoptions"} = "-v$gtts_lang_map{$language} ";
}
@@ -240,14 +240,18 @@ sub voicestring {
system($cmd);
}
elsif ($name eq 'espeak') {
- $cmd = "espeak $tts_engine_opts -w \"$output\" \"$string\"";
+ $cmd = "espeak $tts_engine_opts -w \"$output\" --stdin";
print("> $cmd\n") if $verbose;
- system($cmd);
+ open(RBSPEAK, "| $cmd");
+ print RBSPEAK $string . "\n";
+ close(RBSPEAK);
}
elsif ($name eq 'espeak-ng') {
- $cmd = "espeak-ng $tts_engine_opts -w \"$output\" \"$string\"";
+ $cmd = "espeak-ng $tts_engine_opts -w \"$output\" --stdin";
print("> $cmd\n") if $verbose;
- system($cmd);
+ open(RBSPEAK, "| $cmd");
+ print RBSPEAK $string . "\n";
+ close(RBSPEAK);
}
elsif ($name eq 'sapi') {
print({$$tts_object{"stdin"}} "SPEAK\t$output\t$string\r\n");
@@ -266,14 +270,18 @@ sub voicestring {
close(RBSPEAK);
}
elsif ($name eq 'mimic') {
- $cmd = "mimic $tts_engine_opts -o $output -t \"$string\" ";
+ $cmd = "mimic $tts_engine_opts -o $output";
print("> $cmd\n") if $verbose;
- system($cmd);
+ open(RBSPEAK, "| $cmd");
+ print RBSPEAK $string . "\n";
+ close(RBSPEAK);
}
elsif ($name eq 'gtts') {
- $cmd = "gtts-cli $tts_engine_opts -o $output \"$string\"";
+ $cmd = "gtts-cli $tts_engine_opts -o $output -";
print("> $cmd\n") if $verbose;
- system($cmd);
+ open(RBSPEAK, "| $cmd");
+ print RBSPEAK $string . "\n";
+ close(RBSPEAK);
}
}