diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-11-18 18:44:45 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-11-18 18:44:45 +0000 |
commit | 984a6b023684de78e41dae320721b4b28f17f108 (patch) | |
tree | e8a2d758ecd64cc1e3fc661586cdef2a2897c094 | |
parent | e25a65a1988c8730279582131acd52583282749e (diff) | |
download | rockbox-984a6b023684de78e41dae320721b4b28f17f108.tar.gz rockbox-984a6b023684de78e41dae320721b4b28f17f108.zip |
Add the tools dir to the path in voice.pl, for easier calling of the various tools. Fixes the problem of building swcodec voice files on cygwin (needs reconfiguring).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15672 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-x | tools/configure | 2 | ||||
-rwxr-xr-x | tools/voice.pl | 18 |
2 files changed, 9 insertions, 11 deletions
diff --git a/tools/configure b/tools/configure index 8423482b50..a3e99187a3 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -452,7 +452,7 @@ voiceconfig () { | |||
452 | 452 | ||
453 | if [ "$swcodec" = "yes" ]; then | 453 | if [ "$swcodec" = "yes" ]; then |
454 | ENCODER="rbspeexenc" | 454 | ENCODER="rbspeexenc" |
455 | ENC_CMD="$rootdir/tools/rbspeexenc" | 455 | ENC_CMD="rbspeexenc" |
456 | ENC_OPTS="-q 4 -c 10" | 456 | ENC_OPTS="-q 4 -c 10" |
457 | else | 457 | else |
458 | if [ -f "`which lame`" ]; then | 458 | if [ -f "`which lame`" ]; then |
diff --git a/tools/voice.pl b/tools/voice.pl index 0549cccb00..9935aed618 100755 --- a/tools/voice.pl +++ b/tools/voice.pl | |||
@@ -84,7 +84,7 @@ sub init_tts { | |||
84 | case "sapi" { | 84 | case "sapi" { |
85 | my $toolsdir = dirname($0); | 85 | my $toolsdir = dirname($0); |
86 | my $path = `cygpath $toolsdir -a -w`; | 86 | my $path = `cygpath $toolsdir -a -w`; |
87 | chomp($path); | 87 | chomp($path); |
88 | $path = $path . '\\'; | 88 | $path = $path . '\\'; |
89 | my $cmd = $path . "sapi_voice.vbs /language:$language $tts_engine_opts"; | 89 | my $cmd = $path . "sapi_voice.vbs /language:$language $tts_engine_opts"; |
90 | $cmd =~ s/\\/\\\\/g; | 90 | $cmd =~ s/\\/\\\\/g; |
@@ -98,7 +98,6 @@ sub init_tts { | |||
98 | %ret = (%ret, | 98 | %ret = (%ret, |
99 | "stdin" => *CMD_IN, | 99 | "stdin" => *CMD_IN, |
100 | "stdout" => *CMD_OUT, | 100 | "stdout" => *CMD_OUT, |
101 | "toolspath" => $path, | ||
102 | "vendor" => $vendor); | 101 | "vendor" => $vendor); |
103 | } | 102 | } |
104 | } | 103 | } |
@@ -247,12 +246,11 @@ sub wavtrim { | |||
247 | our $verbose; | 246 | our $verbose; |
248 | my ($file, $threshold, $tts_object) = @_; | 247 | my ($file, $threshold, $tts_object) = @_; |
249 | printf("Trim \"%s\"\n", $file) if $verbose; | 248 | printf("Trim \"%s\"\n", $file) if $verbose; |
249 | my $cmd = "wavtrim \"$file\" $threshold"; | ||
250 | if ($$tts_object{"name"} eq "sapi") { | 250 | if ($$tts_object{"name"} eq "sapi") { |
251 | my $cmd = $$tts_object{"toolspath"}."wavtrim $file $threshold"; | ||
252 | print({$$tts_object{"stdin"}} "EXEC\t$cmd\r\n"); | 251 | print({$$tts_object{"stdin"}} "EXEC\t$cmd\r\n"); |
253 | } | 252 | } |
254 | else { | 253 | else { |
255 | my $cmd = dirname($0) . "/wavtrim \"$file\" $threshold"; | ||
256 | print("> $cmd\n") if $verbose; | 254 | print("> $cmd\n") if $verbose; |
257 | `$cmd`; | 255 | `$cmd`; |
258 | } | 256 | } |
@@ -262,9 +260,8 @@ sub wavtrim { | |||
262 | sub encodewav { | 260 | sub encodewav { |
263 | our $verbose; | 261 | our $verbose; |
264 | my ($input, $output, $encoder, $encoder_opts, $tts_object) = @_; | 262 | my ($input, $output, $encoder, $encoder_opts, $tts_object) = @_; |
265 | my $cmd = ''; | ||
266 | printf("Encode \"%s\" with %s in file %s\n", $input, $encoder, $output) if $verbose; | 263 | printf("Encode \"%s\" with %s in file %s\n", $input, $encoder, $output) if $verbose; |
267 | $cmd = "$encoder $encoder_opts \"$input\" \"$output\""; | 264 | my $cmd = "$encoder $encoder_opts \"$input\" \"$output\""; |
268 | if ($$tts_object{"name"} eq "sapi") { | 265 | if ($$tts_object{"name"} eq "sapi") { |
269 | print({$$tts_object{"stdin"}} "EXEC\t$cmd\r\n"); | 266 | print({$$tts_object{"stdin"}} "EXEC\t$cmd\r\n"); |
270 | } | 267 | } |
@@ -288,12 +285,11 @@ sub synchronize { | |||
288 | sub generateclips { | 285 | sub generateclips { |
289 | our $verbose; | 286 | our $verbose; |
290 | my ($language, $target, $encoder, $encoder_opts, $tts_engine, $tts_engine_opts) = @_; | 287 | my ($language, $target, $encoder, $encoder_opts, $tts_engine, $tts_engine_opts) = @_; |
291 | my $genlang = dirname($0) . '/genlang'; | ||
292 | my $english = dirname($0) . '/../apps/lang/english.lang'; | 288 | my $english = dirname($0) . '/../apps/lang/english.lang'; |
293 | my $langfile = dirname($0) . '/../apps/lang/' . $language . '.lang'; | 289 | my $langfile = dirname($0) . '/../apps/lang/' . $language . '.lang'; |
294 | my $id = ''; | 290 | my $id = ''; |
295 | my $voice = ''; | 291 | my $voice = ''; |
296 | my $cmd = "$genlang -o -t=$target -e=$english $langfile 2>/dev/null"; | 292 | my $cmd = "genlang -o -t=$target -e=$english $langfile 2>/dev/null"; |
297 | my $pool_file; | 293 | my $pool_file; |
298 | open(VOICEFONTIDS, "> voicefontids"); | 294 | open(VOICEFONTIDS, "> voicefontids"); |
299 | my $i = 0; | 295 | my $i = 0; |
@@ -366,14 +362,13 @@ sub generateclips { | |||
366 | sub createvoice { | 362 | sub createvoice { |
367 | our $verbose; | 363 | our $verbose; |
368 | my ($language, $target_id) = @_; | 364 | my ($language, $target_id) = @_; |
369 | my $voicefont = dirname($0) . '/voicefont'; | ||
370 | my $outfile = ""; | 365 | my $outfile = ""; |
371 | my $i = 0; | 366 | my $i = 0; |
372 | do { | 367 | do { |
373 | $outfile = sprintf("%s%s.voice", $language, ($i++ == 0 ? '' : '-'.$i)); | 368 | $outfile = sprintf("%s%s.voice", $language, ($i++ == 0 ? '' : '-'.$i)); |
374 | } while (-f $outfile); | 369 | } while (-f $outfile); |
375 | printf("Saving voice file to %s\n", $outfile) if $verbose; | 370 | printf("Saving voice file to %s\n", $outfile) if $verbose; |
376 | my $cmd = "$voicefont 'voicefontids' $target_id ./ $outfile"; | 371 | my $cmd = "voicefont 'voicefontids' $target_id ./ $outfile"; |
377 | print("> $cmd\n") if $verbose; | 372 | print("> $cmd\n") if $verbose; |
378 | my $output = `$cmd`; | 373 | my $output = `$cmd`; |
379 | print($output) if $verbose; | 374 | print($output) if $verbose; |
@@ -458,6 +453,9 @@ if (defined($v) or defined($ENV{'V'})) { | |||
458 | our $verbose = 1; | 453 | our $verbose = 1; |
459 | } | 454 | } |
460 | 455 | ||
456 | # add the tools dir to the path temporarily, for calling various tools | ||
457 | $ENV{'PATH'} = dirname($0) . ':' . $ENV{'PATH'}; | ||
458 | |||
461 | 459 | ||
462 | # Do what we're told | 460 | # Do what we're told |
463 | if ($V == 1) { | 461 | if ($V == 1) { |