diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-07-11 11:21:26 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-07-11 17:22:06 +0000 |
commit | b546d9d172bfca7f050e40244cd5d6f0fbd96c90 (patch) | |
tree | 0d1e647fca11ef031010ba3dc3ddecf236af089f /tools | |
parent | aad57ea1cc59144475cc80538523121d97b293d4 (diff) | |
download | rockbox-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')
-rw-r--r-- | tools/builds.pm | 30 | ||||
-rwxr-xr-x | tools/voice.pl | 26 |
2 files changed, 47 insertions, 9 deletions
diff --git a/tools/builds.pm b/tools/builds.pm index a69300cd3f..776f807f9d 100644 --- a/tools/builds.pm +++ b/tools/builds.pm | |||
@@ -526,6 +526,16 @@ sub allbuilds { | |||
526 | 'gtts' => '-l en-gb', | 526 | 'gtts' => '-l en-gb', |
527 | }, | 527 | }, |
528 | }, | 528 | }, |
529 | 'deutsch' => { | ||
530 | 'lang' => 'deutsch', | ||
531 | 'name' => 'Deutsch (German)', | ||
532 | 'short' => 'de', | ||
533 | 'defengine' => 'espeak', | ||
534 | 'engines' => { | ||
535 | 'espeak' => '-vde', | ||
536 | 'gtts' => '-l de', | ||
537 | }, | ||
538 | }, | ||
529 | # Everything else in alphabetical order | 539 | # Everything else in alphabetical order |
530 | 'english-us' => { | 540 | 'english-us' => { |
531 | 'lang' => 'english-us', | 541 | 'lang' => 'english-us', |
@@ -548,6 +558,26 @@ sub allbuilds { | |||
548 | 'gtts' => '-l el', | 558 | 'gtts' => '-l el', |
549 | }, | 559 | }, |
550 | }, | 560 | }, |
561 | 'italiano' => { | ||
562 | 'lang' => 'italiano', | ||
563 | 'name' => 'Italiano (Italian)', | ||
564 | 'short' => 'it', | ||
565 | 'defengine' => 'espeak', | ||
566 | 'engines' => { | ||
567 | 'espeak' => '-vit', | ||
568 | 'gtts' => '-l it', | ||
569 | }, | ||
570 | }, | ||
571 | 'norsk' => { | ||
572 | 'lang' => 'norsk', | ||
573 | 'name' => 'Norsk (Norwegian)', | ||
574 | 'short' => 'no', | ||
575 | 'defengine' => 'espeak', | ||
576 | 'engines' => { | ||
577 | 'espeak' => '-vno', | ||
578 | 'gtts' => '-l no', | ||
579 | }, | ||
580 | }, | ||
551 | 'polski' => { | 581 | 'polski' => { |
552 | 'lang' => 'polski', | 582 | 'lang' => 'polski', |
553 | 'name' => 'Polski (Polish)', | 583 | 'name' => 'Polski (Polish)', |
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 | ||