summaryrefslogtreecommitdiff
path: root/tools/voice.pl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/voice.pl')
-rwxr-xr-xtools/voice.pl20
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/voice.pl b/tools/voice.pl
index bec358f5fe..3c7d36bf71 100755
--- a/tools/voice.pl
+++ b/tools/voice.pl
@@ -80,12 +80,12 @@ sub init_tts {
80 $SIG{KILL} = sub { kill TERM => $pid; print("boo"); panic_cleanup(); }; 80 $SIG{KILL} = sub { kill TERM => $pid; print("boo"); panic_cleanup(); };
81 $ret{"pid"} = $pid; 81 $ret{"pid"} = $pid;
82 } 82 }
83 case "sapi5" { 83 case "sapi" {
84 my $toolsdir = dirname($0); 84 my $toolsdir = dirname($0);
85 my $path = `cygpath $toolsdir -a -w`; 85 my $path = `cygpath $toolsdir -a -w`;
86 chomp($path); 86 chomp($path);
87 $path = $path . '\\'; 87 $path = $path . '\\';
88 my $cmd = $path . "sapi5_voice_new.vbs $language $tts_engine_opts"; 88 my $cmd = $path . "sapi_voice.vbs /language:$language $tts_engine_opts";
89 $cmd =~ s/\\/\\\\/g; 89 $cmd =~ s/\\/\\\\/g;
90 print("> cscript //nologo $cmd\n") if $verbose; 90 print("> cscript //nologo $cmd\n") if $verbose;
91 my $pid = open2(*CMD_OUT, *CMD_IN, "cscript //nologo $cmd"); 91 my $pid = open2(*CMD_OUT, *CMD_IN, "cscript //nologo $cmd");
@@ -105,7 +105,7 @@ sub shutdown_tts {
105 # Send SIGTERM to festival server 105 # Send SIGTERM to festival server
106 kill TERM => $$tts_object{"pid"}; 106 kill TERM => $$tts_object{"pid"};
107 } 107 }
108 case "sapi5" { 108 case "sapi" {
109 print({$$tts_object{"stdin"}} "QUIT\r\n"); 109 print({$$tts_object{"stdin"}} "QUIT\r\n");
110 close($$tts_object{"stdin"}); 110 close($$tts_object{"stdin"});
111 } 111 }
@@ -181,8 +181,8 @@ sub voicestring {
181 print ESPEAK $string . "\n"; 181 print ESPEAK $string . "\n";
182 close(ESPEAK); 182 close(ESPEAK);
183 } 183 }
184 case "sapi5" { 184 case "sapi" {
185 print({$$tts_object{"stdin"}} sprintf("SPEAK\t%s\t%s\r\n", $output, $string)); 185 print({$$tts_object{"stdin"}} "SPEAK\t$output\t$string\r\n");
186 } 186 }
187 case "swift" { 187 case "swift" {
188 $cmd = "swift $tts_engine_opts -o $output \"$string\""; 188 $cmd = "swift $tts_engine_opts -o $output \"$string\"";
@@ -197,9 +197,9 @@ sub wavtrim {
197 our $verbose; 197 our $verbose;
198 my ($file, $threshold, $tts_object) = @_; 198 my ($file, $threshold, $tts_object) = @_;
199 printf("Trim \"%s\"\n", $file) if $verbose; 199 printf("Trim \"%s\"\n", $file) if $verbose;
200 if ($$tts_object{"name"} eq "sapi5") { 200 if ($$tts_object{"name"} eq "sapi") {
201 my $cmd = $$tts_object{"toolspath"}."wavtrim $file $threshold"; 201 my $cmd = $$tts_object{"toolspath"}."wavtrim $file $threshold";
202 print({$$tts_object{"stdin"}} sprintf("EXEC\t%s\r\n", $cmd)); 202 print({$$tts_object{"stdin"}} "EXEC\t$cmd\r\n");
203 } 203 }
204 else { 204 else {
205 my $cmd = dirname($0) . "/wavtrim $file $threshold"; 205 my $cmd = dirname($0) . "/wavtrim $file $threshold";
@@ -225,8 +225,8 @@ sub encodewav {
225 $cmd = "speexenc $encoder_opts \"$input\" \"$output\""; 225 $cmd = "speexenc $encoder_opts \"$input\" \"$output\"";
226 } 226 }
227 } 227 }
228 if ($$tts_object{"name"} eq "sapi5") { 228 if ($$tts_object{"name"} eq "sapi") {
229 print({$$tts_object{"stdin"}} sprintf("EXEC\t%s\r\n", $cmd)); 229 print({$$tts_object{"stdin"}} "EXEC\t$cmd\r\n");
230 } 230 }
231 else { 231 else {
232 print("> $cmd\n") if $verbose; 232 print("> $cmd\n") if $verbose;
@@ -237,7 +237,7 @@ sub encodewav {
237# synchronize the clip generation / processing if it's running in another process 237# synchronize the clip generation / processing if it's running in another process
238sub synchronize { 238sub synchronize {
239 my ($tts_object) = @_; 239 my ($tts_object) = @_;
240 if ($$tts_object{"name"} eq "sapi5") { 240 if ($$tts_object{"name"} eq "sapi") {
241 print({$$tts_object{"stdin"}} "SYNC\t42\r\n"); 241 print({$$tts_object{"stdin"}} "SYNC\t42\r\n");
242 my $wait = readline($$tts_object{"stdout"}); 242 my $wait = readline($$tts_object{"stdout"});
243 #ignore what's actually returned 243 #ignore what's actually returned