summaryrefslogtreecommitdiffstats
path: root/tools
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
parentaad57ea1cc59144475cc80538523121d97b293d4 (diff)
downloadrockbox-b546d9d172bfca7f050e40244cd5d6f0fbd96c90.tar.gz
rockbox-b546d9d172bfca7f050e40244cd5d6f0fbd96c90.tar.bz2
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.pm30
-rwxr-xr-xtools/voice.pl26
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 {
'gtts' => '-l en-gb',
},
},
+ 'deutsch' => {
+ 'lang' => 'deutsch',
+ 'name' => 'Deutsch (German)',
+ 'short' => 'de',
+ 'defengine' => 'espeak',
+ 'engines' => {
+ 'espeak' => '-vde',
+ 'gtts' => '-l de',
+ },
+ },
# Everything else in alphabetical order
'english-us' => {
'lang' => 'english-us',
@@ -548,6 +558,26 @@ sub allbuilds {
'gtts' => '-l el',
},
},
+ 'italiano' => {
+ 'lang' => 'italiano',
+ 'name' => 'Italiano (Italian)',
+ 'short' => 'it',
+ 'defengine' => 'espeak',
+ 'engines' => {
+ 'espeak' => '-vit',
+ 'gtts' => '-l it',
+ },
+ },
+ 'norsk' => {
+ 'lang' => 'norsk',
+ 'name' => 'Norsk (Norwegian)',
+ 'short' => 'no',
+ 'defengine' => 'espeak',
+ 'engines' => {
+ 'espeak' => '-vno',
+ 'gtts' => '-l no',
+ },
+ },
'polski' => {
'lang' => 'polski',
'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 {
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);
}
}