summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2007-11-18 17:10:50 +0000
committerThom Johansen <thomj@rockbox.org>2007-11-18 17:10:50 +0000
commit75432619e8be2f22f86ed0869d46bf7245c7c14d (patch)
tree236b4e1ef8c6f2130091e1539e5d4566efce33aa /tools
parentbcde33b60b50e047e46375f81a9a60d8f35560a2 (diff)
downloadrockbox-75432619e8be2f22f86ed0869d46bf7245c7c14d.tar.gz
rockbox-75432619e8be2f22f86ed0869d46bf7245c7c14d.tar.bz2
rockbox-75432619e8be2f22f86ed0869d46bf7245c7c14d.zip
Introduce use of the new Speex voice file encoder in voice builds. Remove the very unfinished support for other encoders and force use of either rbspeexenc for SWCODEC or LAME for HWCODEC. Update voice.pl to work with the new system, and remove a bug in the same go. Remember to rerun "configure" if you want to build voice files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15667 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rwxr-xr-xtools/configure66
-rwxr-xr-xtools/voice.pl14
2 files changed, 19 insertions, 61 deletions
diff --git a/tools/configure b/tools/configure
index 9ee2d3a5cb..0eb577f60e 100755
--- a/tools/configure
+++ b/tools/configure
@@ -450,54 +450,22 @@ voiceconfig () {
echo ""
- if [ -f "`which oggenc`" ]; then
- OGGENC="(O)ggenc "
- DEFAULT_ENC="oggenc"
- VORBIS_OPTS="-q0 --downmix"
- DEFAULT_ENC_OPTS=$VORBIS_OPTS
- DEFAULT_CHOICE="O"
- fi
- if [ -f "`which speexenc`" ]; then
- SPEEXENC="(S)peexenc "
- DEFAULT_ENC="speexenc"
- SPEEX_OPTS="" # TODO: find appropriate options for speex
- DEFAULT_ENC_OPTS=$SPEEX_OPTS
- DEFAULT_CHOICE="S"
- fi
- if [ -f "`which lame`" ]; then
- LAME="(L)ame "
- DEFAULT_ENC="lame"
- LAME_OPTS="--resample 12 -t -m m -h -V 9 -S -B 64 --vbr-new"
- DEFAULT_ENC_OPTS=$LAME_OPTS
- DEFAULT_CHOICE="L"
- fi
-
- if [ "$LAME" = "" ]; then
- echo "You currently need to have Lame installed to build voice files"
+ if [ "$swcodec" = "yes" ]; then
+ ENCODER="rbspeexenc"
+ ENC_CMD="$rootdir/tools/rbspeexenc"
+ ENC_OPTS="-q 4 -c 10"
+ else
+ if [ -f "`which lame`" ]; then
+ ENCODER="lame"
+ ENC_CMD="lame"
+ ENC_OPTS="--resample 12 -t -m m -h -V 9 -S -B 64 --vbr-new"
+ else
+ echo "You need LAME in the system path to build voice files for"
+ echo "HWCODEC targets."
+ exit
+ fi
fi
-
-# echo "Encoder to use: ${LAME}${OGGENC}${SPEEXENC}(${DEFAULT_CHOICE})?"
-# echo ""
-# echo "Note: Use Lame - the other options won't work"
-# option=`input`
- option="l"
- case "$option" in
- [Oo])
- ENCODER="oggenc"
- ENC_OPTS=$VORBIS_OPTS
- ;;
- [Ss])
- ENCODER="speexenc"
- ENC_OPTS=$SPEEX_OPTS
- ;;
- [Ll])
- ENCODER="lame"
- ENC_OPTS=$LAME_OPTS
- ;;
- *)
- ENCODER=$DEFAULT_ENC
- ENC_OPTS=$DEFAULT_ENC_OPTS
- esac
+
echo "Using $ENCODER for encoding voice clips"
# Allow the user to input manual commandline options
@@ -1859,7 +1827,7 @@ sed > Makefile \
-e "${simmagic1}" \
-e "${simmagic2}" \
-e "s,@MANUALDEV@,${manualdev},g" \
- -e "s,@ENCODER@,${ENCODER},g" \
+ -e "s,@ENCODER@,${ENC_CMD},g" \
-e "s,@ENC_OPTS@,${ENC_OPTS},g" \
-e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
-e "s,@TTS_OPTS@,${TTS_OPTS},g" \
@@ -2073,7 +2041,7 @@ if [ "yes" = "$voice" ]; then
voice: voicetools features
\$(SILENT)for f in \`cat \$(BUILDDIR)/${apps}/features\`; do feat="\$\$feat:\$\$f" ; done ; \\
- for lang in \`echo \$(VOICELANGUAGE) |sed "s/,/ /g"\`; do \$(TOOLSDIR)/voice.pl -V -l=\$\$lang -t=\$(ARCHOS)\$\$feat -i=\$(TARGET_ID) -e=\$(ENCODER) -E="\$(ENC_OPTS)" -s=\$(TTS_ENGINE) -S="\$(TTS_OPTS)"; done \\
+ for lang in \`echo \$(VOICELANGUAGE) |sed "s/,/ /g"\`; do \$(TOOLSDIR)/voice.pl -V -l=\$\$lang -t=\$(ARCHOS)\$\$feat -i=\$(TARGET_ID) -e="\$(ENCODER)" -E="\$(ENC_OPTS)" -s=\$(TTS_ENGINE) -S="\$(TTS_OPTS)"; done \\
EOF
fi
diff --git a/tools/voice.pl b/tools/voice.pl
index 7d44def7b0..0549cccb00 100755
--- a/tools/voice.pl
+++ b/tools/voice.pl
@@ -264,17 +264,7 @@ sub encodewav {
my ($input, $output, $encoder, $encoder_opts, $tts_object) = @_;
my $cmd = '';
printf("Encode \"%s\" with %s in file %s\n", $input, $encoder, $output) if $verbose;
- switch ($encoder) {
- case 'lame' {
- $cmd = "lame $encoder_opts \"$input\" \"$output\"";
- }
- case 'vorbis' {
- $cmd = "oggenc $encoder_opts \"$input\" -o \"$output\"";
- }
- case 'speexenc' {
- $cmd = "speexenc $encoder_opts \"$input\" \"$output\"";
- }
- }
+ $cmd = "$encoder $encoder_opts \"$input\" \"$output\"";
if ($$tts_object{"name"} eq "sapi") {
print({$$tts_object{"stdin"}} "EXEC\t$cmd\r\n");
}
@@ -484,7 +474,7 @@ if ($V == 1) {
elsif ($C) {
printf("Generating .talk clips\n Path: %s\n Language: %s\n Encoder (options): %s (%s)\n TTS Engine (options): %s (%s)\n", $ARGV[0], $l, $e, $E, $s, $S);
my $tts_object = init_tts($s, $S, $l);
- gentalkclips($ARGV[0], $tts_object, $e, $E, 0);
+ gentalkclips($ARGV[0], $tts_object, $e, $E, $S, 0);
shutdown_tts($tts_object);
}
else {