summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/voice.pl9
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`;