diff options
author | Jens Arnold <amiconn@rockbox.org> | 2008-08-08 08:35:17 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2008-08-08 08:35:17 +0000 |
commit | f834968e5e4ec71a95f302b361e3b308ebb31a0e (patch) | |
tree | 151e6dc0ba927a27ed0928147270c345b3c0ad80 /tools | |
parent | 18e8f7993a95def72e41f299246b6f6a4d9ab932 (diff) | |
download | rockbox-f834968e5e4ec71a95f302b361e3b308ebb31a0e.tar.gz rockbox-f834968e5e4ec71a95f302b361e3b308ebb31a0e.zip |
Let PerlIO also do the LF<->CRLF conversion for SAPI.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18218 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/voice.pl | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/voice.pl b/tools/voice.pl index 64c96800f4..1cf6076efb 100755 --- a/tools/voice.pl +++ b/tools/voice.pl | |||
@@ -91,13 +91,13 @@ sub init_tts { | |||
91 | $cmd =~ s/\\/\\\\/g; | 91 | $cmd =~ s/\\/\\\\/g; |
92 | print("> cscript //nologo $cmd\n") if $verbose; | 92 | print("> cscript //nologo $cmd\n") if $verbose; |
93 | my $pid = open2(*CMD_OUT, *CMD_IN, "cscript //nologo $cmd"); | 93 | my $pid = open2(*CMD_OUT, *CMD_IN, "cscript //nologo $cmd"); |
94 | binmode(*CMD_IN, ':encoding(utf16le)'); | 94 | binmode(*CMD_IN, ':encoding(utf16le):crlf'); |
95 | binmode(*CMD_OUT, ':encoding(utf16le)'); | 95 | binmode(*CMD_OUT, ':encoding(utf16le):crlf'); |
96 | $SIG{INT} = sub { print(CMD_IN "QUIT\r\n"); panic_cleanup(); }; | 96 | $SIG{INT} = sub { print(CMD_IN "QUIT\n"); panic_cleanup(); }; |
97 | $SIG{KILL} = sub { print(CMD_IN "QUIT\r\n"); panic_cleanup(); }; | 97 | $SIG{KILL} = sub { print(CMD_IN "QUIT\n"); panic_cleanup(); }; |
98 | print(CMD_IN "QUERY\tVENDOR\r\n"); | 98 | print(CMD_IN "QUERY\tVENDOR\n"); |
99 | my $vendor = readline(*CMD_OUT); | 99 | my $vendor = readline(*CMD_OUT); |
100 | $vendor =~ s/\r\n//; | 100 | chomp($vendor); |
101 | %ret = (%ret, | 101 | %ret = (%ret, |
102 | "stdin" => *CMD_IN, | 102 | "stdin" => *CMD_IN, |
103 | "stdout" => *CMD_OUT, | 103 | "stdout" => *CMD_OUT, |
@@ -116,7 +116,7 @@ sub shutdown_tts { | |||
116 | kill TERM => $$tts_object{"pid"}; | 116 | kill TERM => $$tts_object{"pid"}; |
117 | } | 117 | } |
118 | case "sapi" { | 118 | case "sapi" { |
119 | print({$$tts_object{"stdin"}} "QUIT\r\n"); | 119 | print({$$tts_object{"stdin"}} "QUIT\n"); |
120 | close($$tts_object{"stdin"}); | 120 | close($$tts_object{"stdin"}); |
121 | } | 121 | } |
122 | } | 122 | } |
@@ -274,7 +274,7 @@ sub voicestring { | |||
274 | close(ESPEAK); | 274 | close(ESPEAK); |
275 | } | 275 | } |
276 | case "sapi" { | 276 | case "sapi" { |
277 | print({$$tts_object{"stdin"}} "SPEAK\t$output\t$string\r\n"); | 277 | print({$$tts_object{"stdin"}} "SPEAK\t$output\t$string\n"); |
278 | } | 278 | } |
279 | case "swift" { | 279 | case "swift" { |
280 | $cmd = "swift $tts_engine_opts -o \"$output\" \"$string\""; | 280 | $cmd = "swift $tts_engine_opts -o \"$output\" \"$string\""; |
@@ -291,7 +291,7 @@ sub wavtrim { | |||
291 | printf("Trim \"%s\"\n", $file) if $verbose; | 291 | printf("Trim \"%s\"\n", $file) if $verbose; |
292 | my $cmd = "wavtrim \"$file\" $threshold"; | 292 | my $cmd = "wavtrim \"$file\" $threshold"; |
293 | if ($$tts_object{"name"} eq "sapi") { | 293 | if ($$tts_object{"name"} eq "sapi") { |
294 | print({$$tts_object{"stdin"}} "EXEC\t$cmd\r\n"); | 294 | print({$$tts_object{"stdin"}} "EXEC\t$cmd\n"); |
295 | } | 295 | } |
296 | else { | 296 | else { |
297 | print("> $cmd\n") if $verbose; | 297 | print("> $cmd\n") if $verbose; |
@@ -306,7 +306,7 @@ sub encodewav { | |||
306 | printf("Encode \"%s\" with %s in file %s\n", $input, $encoder, $output) if $verbose; | 306 | printf("Encode \"%s\" with %s in file %s\n", $input, $encoder, $output) if $verbose; |
307 | my $cmd = "$encoder $encoder_opts \"$input\" \"$output\""; | 307 | my $cmd = "$encoder $encoder_opts \"$input\" \"$output\""; |
308 | if ($$tts_object{"name"} eq "sapi") { | 308 | if ($$tts_object{"name"} eq "sapi") { |
309 | print({$$tts_object{"stdin"}} "EXEC\t$cmd\r\n"); | 309 | print({$$tts_object{"stdin"}} "EXEC\t$cmd\n"); |
310 | } | 310 | } |
311 | else { | 311 | else { |
312 | print("> $cmd\n") if $verbose; | 312 | print("> $cmd\n") if $verbose; |
@@ -318,7 +318,7 @@ sub encodewav { | |||
318 | sub synchronize { | 318 | sub synchronize { |
319 | my ($tts_object) = @_; | 319 | my ($tts_object) = @_; |
320 | if ($$tts_object{"name"} eq "sapi") { | 320 | if ($$tts_object{"name"} eq "sapi") { |
321 | print({$$tts_object{"stdin"}} "SYNC\t42\r\n"); | 321 | print({$$tts_object{"stdin"}} "SYNC\t42\n"); |
322 | my $wait = readline($$tts_object{"stdout"}); | 322 | my $wait = readline($$tts_object{"stdout"}); |
323 | #ignore what's actually returned | 323 | #ignore what's actually returned |
324 | } | 324 | } |