1
0
Fork 0
forked from len0rd/rockbox

voice.pl: Fix an issue with the piper tts engine

It only arose with the dailybuild scripts.

Change-Id: Iefb0fbab39846df6e52b3860f3d74e6dc9c39305
This commit is contained in:
Solomon Peachy 2024-06-23 19:33:22 -04:00
parent 4c9d346cb2
commit 8f75b29aed

View file

@ -178,6 +178,10 @@ sub init_tts {
$ret{"ttsoptions"} = "--language $festival_lang_map{$language} "; $ret{"ttsoptions"} = "--language $festival_lang_map{$language} ";
} }
} elsif ($tts_engine eq 'piper') { } elsif ($tts_engine eq 'piper') {
if (defined($piper_lang_map{$language}) && $tts_engine_opts !~ /--model/) {
die("Need PIPER_MODEL_DIR\n") if (!defined($ENV{'PIPER_MODEL_DIR'}));
$tts_engine_opts = "--model $ENV{PIPER_MODEL_DIR}/$piper_lang_map{$language} ";
}
my $cmd = "piper $tts_engine_opts --json-input"; my $cmd = "piper $tts_engine_opts --json-input";
print("> $cmd\n") if $verbose; print("> $cmd\n") if $verbose;
@ -188,10 +192,7 @@ sub init_tts {
binmode(*CMD_IN, ':encoding(utf8)'); binmode(*CMD_IN, ':encoding(utf8)');
binmode(*CMD_OUT, ':encoding(utf8)'); binmode(*CMD_OUT, ':encoding(utf8)');
binmode(*CMD_ERR, ':encoding(utf8)'); binmode(*CMD_ERR, ':encoding(utf8)');
if (defined($piper_lang_map{$language}) && $tts_engine_opts !~ /--model/) {
die("Need PIPER_MODEL_DIR\n") if (!defined($ENV{'PIPER_MODEL_DIR'}));
$ret{"ttsoptions"} = "--model $ENV{PIPER_MODEL_DIR}/$piper_lang_map{$language} ";
}
} elsif ($tts_engine eq 'sapi') { } elsif ($tts_engine eq 'sapi') {
my $toolsdir = dirname($0); my $toolsdir = dirname($0);
my $path = `cygpath $toolsdir -a -w`; my $path = `cygpath $toolsdir -a -w`;