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)
downloadrockbox-b546d9d172bfca7f050e40244cd5d6f0fbd96c90.tar.gz
rockbox-b546d9d172bfca7f050e40244cd5d6f0fbd96c90.zip
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 {
164 if (defined($gtts_lang_map{$language}) && $tts_engine_opts !~ /-l/) { 164 if (defined($gtts_lang_map{$language}) && $tts_engine_opts !~ /-l/) {
165 $ret{"ttsoptions"} = "-l $gtts_lang_map{$language} "; 165 $ret{"ttsoptions"} = "-l $gtts_lang_map{$language} ";
166 } 166 }
167 } elsif ($tts_engine eq 'espeak') { 167 } elsif ($tts_engine eq 'espeak' || $tts_engine eq 'espeak-ng') {
168 if (defined($espeak_lang_map{$language}) && $tts_engine_opts !~ /-v/) { 168 if (defined($espeak_lang_map{$language}) && $tts_engine_opts !~ /-v/) {
169 $ret{"ttsoptions"} = "-v$gtts_lang_map{$language} "; 169 $ret{"ttsoptions"} = "-v$gtts_lang_map{$language} ";
170 } 170 }
@@ -240,14 +240,18 @@ sub voicestring {
240 system($cmd); 240 system($cmd);
241 } 241 }
242 elsif ($name eq 'espeak') { 242 elsif ($name eq 'espeak') {
243 $cmd = "espeak $tts_engine_opts -w \"$output\" \"$string\""; 243 $cmd = "espeak $tts_engine_opts -w \"$output\" --stdin";
244 print("> $cmd\n") if $verbose; 244 print("> $cmd\n") if $verbose;
245 system($cmd); 245 open(RBSPEAK, "| $cmd");
246 print RBSPEAK $string . "\n";
247 close(RBSPEAK);
246 } 248 }
247 elsif ($name eq 'espeak-ng') { 249 elsif ($name eq 'espeak-ng') {
248 $cmd = "espeak-ng $tts_engine_opts -w \"$output\" \"$string\""; 250 $cmd = "espeak-ng $tts_engine_opts -w \"$output\" --stdin";
249 print("> $cmd\n") if $verbose; 251 print("> $cmd\n") if $verbose;
250 system($cmd); 252 open(RBSPEAK, "| $cmd");
253 print RBSPEAK $string . "\n";
254 close(RBSPEAK);
251 } 255 }
252 elsif ($name eq 'sapi') { 256 elsif ($name eq 'sapi') {
253 print({$$tts_object{"stdin"}} "SPEAK\t$output\t$string\r\n"); 257 print({$$tts_object{"stdin"}} "SPEAK\t$output\t$string\r\n");
@@ -266,14 +270,18 @@ sub voicestring {
266 close(RBSPEAK); 270 close(RBSPEAK);
267 } 271 }
268 elsif ($name eq 'mimic') { 272 elsif ($name eq 'mimic') {
269 $cmd = "mimic $tts_engine_opts -o $output -t \"$string\" "; 273 $cmd = "mimic $tts_engine_opts -o $output";
270 print("> $cmd\n") if $verbose; 274 print("> $cmd\n") if $verbose;
271 system($cmd); 275 open(RBSPEAK, "| $cmd");
276 print RBSPEAK $string . "\n";
277 close(RBSPEAK);
272 } 278 }
273 elsif ($name eq 'gtts') { 279 elsif ($name eq 'gtts') {
274 $cmd = "gtts-cli $tts_engine_opts -o $output \"$string\""; 280 $cmd = "gtts-cli $tts_engine_opts -o $output -";
275 print("> $cmd\n") if $verbose; 281 print("> $cmd\n") if $verbose;
276 system($cmd); 282 open(RBSPEAK, "| $cmd");
283 print RBSPEAK $string . "\n";
284 close(RBSPEAK);
277 } 285 }
278} 286}
279 287