forked from len0rd/rockbox
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
This commit is contained in:
parent
bcde33b60b
commit
75432619e8
2 changed files with 19 additions and 61 deletions
64
tools/configure
vendored
64
tools/configure
vendored
|
@ -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"
|
||||
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
|
||||
|
||||
if [ "$LAME" = "" ]; then
|
||||
echo "You currently need to have Lame installed to build voice files"
|
||||
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
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue