diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2024-06-23 19:33:22 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-06-23 19:41:53 -0400 |
commit | 8f75b29aed8eeb901244a715595c93656dc18b72 (patch) | |
tree | 7cfaedf7763cdf15aed88417c0eecc0ceec7421f | |
parent | 4c9d346cb27ba122e4e2209f38a554944178d651 (diff) | |
download | rockbox-8f75b29aed8eeb901244a715595c93656dc18b72.tar.gz rockbox-8f75b29aed8eeb901244a715595c93656dc18b72.zip |
voice.pl: Fix an issue with the piper tts engine
It only arose with the dailybuild scripts.
Change-Id: Iefb0fbab39846df6e52b3860f3d74e6dc9c39305
-rwxr-xr-x | tools/voice.pl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/voice.pl b/tools/voice.pl index 1b58f5a67f..1c547c7d96 100755 --- a/tools/voice.pl +++ b/tools/voice.pl | |||
@@ -178,6 +178,10 @@ sub init_tts { | |||
178 | $ret{"ttsoptions"} = "--language $festival_lang_map{$language} "; | 178 | $ret{"ttsoptions"} = "--language $festival_lang_map{$language} "; |
179 | } | 179 | } |
180 | } elsif ($tts_engine eq 'piper') { | 180 | } elsif ($tts_engine eq 'piper') { |
181 | if (defined($piper_lang_map{$language}) && $tts_engine_opts !~ /--model/) { | ||
182 | die("Need PIPER_MODEL_DIR\n") if (!defined($ENV{'PIPER_MODEL_DIR'})); | ||
183 | $tts_engine_opts = "--model $ENV{PIPER_MODEL_DIR}/$piper_lang_map{$language} "; | ||
184 | } | ||
181 | my $cmd = "piper $tts_engine_opts --json-input"; | 185 | my $cmd = "piper $tts_engine_opts --json-input"; |
182 | print("> $cmd\n") if $verbose; | 186 | print("> $cmd\n") if $verbose; |
183 | 187 | ||
@@ -188,10 +192,7 @@ sub init_tts { | |||
188 | binmode(*CMD_IN, ':encoding(utf8)'); | 192 | binmode(*CMD_IN, ':encoding(utf8)'); |
189 | binmode(*CMD_OUT, ':encoding(utf8)'); | 193 | binmode(*CMD_OUT, ':encoding(utf8)'); |
190 | binmode(*CMD_ERR, ':encoding(utf8)'); | 194 | binmode(*CMD_ERR, ':encoding(utf8)'); |
191 | if (defined($piper_lang_map{$language}) && $tts_engine_opts !~ /--model/) { | 195 | |
192 | die("Need PIPER_MODEL_DIR\n") if (!defined($ENV{'PIPER_MODEL_DIR'})); | ||
193 | $ret{"ttsoptions"} = "--model $ENV{PIPER_MODEL_DIR}/$piper_lang_map{$language} "; | ||
194 | } | ||
195 | } elsif ($tts_engine eq 'sapi') { | 196 | } elsif ($tts_engine eq 'sapi') { |
196 | my $toolsdir = dirname($0); | 197 | my $toolsdir = dirname($0); |
197 | my $path = `cygpath $toolsdir -a -w`; | 198 | my $path = `cygpath $toolsdir -a -w`; |