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.zip rockbox-984a6b023684de78e41dae320721b4b28f17f108.tar.gz rockbox-984a6b023684de78e41dae320721b4b28f17f108.tar.bz2 rockbox-984a6b023684de78e41dae320721b4b28f17f108.tar.xz | |
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 8423482..a3e9918 100755 --- a/tools/configure +++ b/tools/configure @@ -452,7 +452,7 @@ voiceconfig () { if [ "$swcodec" = "yes" ]; then ENCODER="rbspeexenc" - ENC_CMD="$rootdir/tools/rbspeexenc" + ENC_CMD="rbspeexenc" ENC_OPTS="-q 4 -c 10" else if [ -f "`which lame`" ]; then diff --git a/tools/voice.pl b/tools/voice.pl index 0549ccc..9935aed 100755 --- a/tools/voice.pl +++ b/tools/voice.pl @@ -84,7 +84,7 @@ sub init_tts { case "sapi" { my $toolsdir = dirname($0); my $path = `cygpath $toolsdir -a -w`; - chomp($path); + chomp($path); $path = $path . '\\'; my $cmd = $path . "sapi_voice.vbs /language:$language $tts_engine_opts"; $cmd =~ s/\\/\\\\/g; @@ -98,7 +98,6 @@ sub init_tts { %ret = (%ret, "stdin" => *CMD_IN, "stdout" => *CMD_OUT, - "toolspath" => $path, "vendor" => $vendor); } } @@ -247,12 +246,11 @@ sub wavtrim { our $verbose; my ($file, $threshold, $tts_object) = @_; printf("Trim \"%s\"\n", $file) if $verbose; + my $cmd = "wavtrim \"$file\" $threshold"; if ($$tts_object{"name"} eq "sapi") { - my $cmd = $$tts_object{"toolspath"}."wavtrim $file $threshold"; print({$$tts_object{"stdin"}} "EXEC\t$cmd\r\n"); } else { - my $cmd = dirname($0) . "/wavtrim \"$file\" $threshold"; print("> $cmd\n") if $verbose; `$cmd`; } @@ -262,9 +260,8 @@ sub wavtrim { sub encodewav { our $verbose; my ($input, $output, $encoder, $encoder_opts, $tts_object) = @_; - my $cmd = ''; printf("Encode \"%s\" with %s in file %s\n", $input, $encoder, $output) if $verbose; - $cmd = "$encoder $encoder_opts \"$input\" \"$output\""; + my $cmd = "$encoder $encoder_opts \"$input\" \"$output\""; if ($$tts_object{"name"} eq "sapi") { print({$$tts_object{"stdin"}} "EXEC\t$cmd\r\n"); } @@ -288,12 +285,11 @@ sub synchronize { sub generateclips { our $verbose; my ($language, $target, $encoder, $encoder_opts, $tts_engine, $tts_engine_opts) = @_; - my $genlang = dirname($0) . '/genlang'; my $english = dirname($0) . '/../apps/lang/english.lang'; my $langfile = dirname($0) . '/../apps/lang/' . $language . '.lang'; my $id = ''; my $voice = ''; - my $cmd = "$genlang -o -t=$target -e=$english $langfile 2>/dev/null"; + my $cmd = "genlang -o -t=$target -e=$english $langfile 2>/dev/null"; my $pool_file; open(VOICEFONTIDS, "> voicefontids"); my $i = 0; @@ -366,14 +362,13 @@ sub generateclips { sub createvoice { our $verbose; my ($language, $target_id) = @_; - my $voicefont = dirname($0) . '/voicefont'; my $outfile = ""; my $i = 0; do { $outfile = sprintf("%s%s.voice", $language, ($i++ == 0 ? '' : '-'.$i)); } while (-f $outfile); printf("Saving voice file to %s\n", $outfile) if $verbose; - my $cmd = "$voicefont 'voicefontids' $target_id ./ $outfile"; + my $cmd = "voicefont 'voicefontids' $target_id ./ $outfile"; print("> $cmd\n") if $verbose; my $output = `$cmd`; print($output) if $verbose; @@ -458,6 +453,9 @@ if (defined($v) or defined($ENV{'V'})) { our $verbose = 1; } +# add the tools dir to the path temporarily, for calling various tools +$ENV{'PATH'} = dirname($0) . ':' . $ENV{'PATH'}; + # Do what we're told if ($V == 1) { |