diff options
-rwxr-xr-x | tools/voice.pl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/voice.pl b/tools/voice.pl index cf15cc5f4a..64c96800f4 100755 --- a/tools/voice.pl +++ b/tools/voice.pl | |||
@@ -241,6 +241,7 @@ sub voicestring { | |||
241 | our $verbose; | 241 | our $verbose; |
242 | my ($string, $output, $tts_engine_opts, $tts_object) = @_; | 242 | my ($string, $output, $tts_engine_opts, $tts_object) = @_; |
243 | my $cmd; | 243 | my $cmd; |
244 | binmode(STDOUT, ':encoding(UTF-8)'); | ||
244 | printf("Generate \"%s\" with %s in file %s\n", $string, $$tts_object{"name"}, $output) if $verbose; | 245 | printf("Generate \"%s\" with %s in file %s\n", $string, $$tts_object{"name"}, $output) if $verbose; |
245 | switch($$tts_object{"name"}) { | 246 | switch($$tts_object{"name"}) { |
246 | case "festival" { | 247 | case "festival" { |
@@ -251,6 +252,7 @@ sub voicestring { | |||
251 | # Open command, and filehandles for STDIN, STDOUT, STDERR | 252 | # Open command, and filehandles for STDIN, STDOUT, STDERR |
252 | my $pid = open3(*CMD_IN, *CMD_OUT, *CMD_ERR, $cmd); | 253 | my $pid = open3(*CMD_IN, *CMD_OUT, *CMD_ERR, $cmd); |
253 | # Put the string to speak into STDIN and close it | 254 | # Put the string to speak into STDIN and close it |
255 | binmode(CMD_IN, ':encoding(utf8)'); | ||
254 | print(CMD_IN $string); | 256 | print(CMD_IN $string); |
255 | close(CMD_IN); | 257 | close(CMD_IN); |
256 | # Read all output from festival_client (because it LIES TO US) | 258 | # Read all output from festival_client (because it LIES TO US) |
@@ -265,10 +267,9 @@ sub voicestring { | |||
265 | `$cmd`; | 267 | `$cmd`; |
266 | } | 268 | } |
267 | case "espeak" { | 269 | case "espeak" { |
268 | # xxx: $tts_engine_opts isn't used | ||
269 | $cmd = "espeak $tts_engine_opts -w \"$output\""; | 270 | $cmd = "espeak $tts_engine_opts -w \"$output\""; |
270 | print("> $cmd\n") if $verbose; | 271 | print("> $cmd\n") if $verbose; |
271 | open(ESPEAK, "| $cmd"); | 272 | open(ESPEAK, "|-:encoding(utf8)", $cmd); |
272 | print ESPEAK $string . "\n"; | 273 | print ESPEAK $string . "\n"; |
273 | close(ESPEAK); | 274 | close(ESPEAK); |
274 | } | 275 | } |