From 58537b43e61b23053371d92e9521e104d0908bca Mon Sep 17 00:00:00 2001 From: Jonas Häggqvist Date: Mon, 13 Aug 2007 12:21:16 +0000 Subject: Voice related changes: - It's now possible to select multiple languages to build - Added encoder and TTS engine configuration to configure (per-language) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14309 a1c6a512-1295-4272-9138-f99709370657 --- tools/configure | 123 +++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 77 insertions(+), 46 deletions(-) (limited to 'tools/configure') diff --git a/tools/configure b/tools/configure index 3af6885ab0..041c7d3f8d 100755 --- a/tools/configure +++ b/tools/configure @@ -284,8 +284,25 @@ whichadvanced () { echo "done" if [ "yes" = "$voice" ]; then - voiceconfig - toolset="${toolset} voicefont wavtrim" + toolset="${toolset} voicefont wavtrim" + + # Ask about languages to build + echo "Select a number for the language to use (default is english)" + echo "You may enter a comma-separated list of languages to build" + + picklang + voicelanguage=`whichlang` + + if [ -z "$voicelanguage" ]; then + # pick a default + voicelanguage="english" + fi + echo "Voice language set to $voicelanguage" + + # Configure encoder and TTS engine for each language + for thislang in `echo $voicelanguage | sed 's/,/ /g'`; do + voiceconfig "$thislang" + done fi if [ "yes" = "$use_debug" ]; then debug="-DDEBUG" @@ -304,8 +321,10 @@ whichadvanced () { fi } +# Configure voice settings voiceconfig () { - echo "Building voice for $archos" + thislang=$1 + echo "Building $thislang voice for $archos. Select options" echo "" if [ "`which flite`" != "" ]; then @@ -377,6 +396,13 @@ voiceconfig () { esac echo "Using $TTS_ENGINE for TTS" + # Allow the user to input manual commandline options + printf "Enter $TTS_ENGINE options (enter for defaults `echo $TTS_OPTS |sed 's/.*=//'`): " + USER_TTS_OPTS=`input` + if [ -n "$USER_TTS_OPTS" ]; then + TTS_OPTS="`echo $TTS_OPTS | sed 's/=.*//'`=\"$USER_TTS_OPTS\"" + fi + echo "" if [ "`which oggenc`" != "" ]; then @@ -402,37 +428,46 @@ voiceconfig () { fi if [ "$LAME" = "" ]; then - echo "You need to have Lame installed to build voice files" + 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` -# case "$option" in -# [Oo]) -# ENCODER="oggenc" -# ENC_OPTS=$VORBIS_OPTS -# ;; -# [Ss]) -# ENCODER="speexenc" -# ENC_OPTS=$SPEEX_OPTS -# ;; -# [Ll]) + 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 + ;; + *) + ENCODER=$DEFAULT_ENC + ENC_OPTS=$DEFAULT_ENC_OPTS + esac echo "Using $ENCODER for encoding voice clips" + + # Allow the user to input manual commandline options + printf "Enter $ENCODER options (enter for defaults `echo $ENC_OPTS |sed 's/.*=//'`): " + USER_ENC_OPTS=`input` + if [ -n "$USER_ENC_OPTS" ]; then + ENC_OPTS="`echo $ENC_OPTS | sed 's/=.*//'`=\"$USER_ENC_OPTS\"" + fi + TEMPDIR="${pwd}" if [ "`which cygpath`" != "" ]; then TEMPDIR=`cygpath . -a -w` fi - cat > voicesettings.sh < voicesettings-$thislang.sh < Makefile \ -e "s,@MANUFACTURER@,${t_manufacturer},g" \ -e "s,@ARCHOS@,${archos},g" \ -e "s,@LANGUAGE@,${language},g" \ - -e "s,@VOICELANGUAGE@,${voicelanguage},g" \ + -e "s:@VOICELANGUAGE@:${voicelanguage}:g" \ -e "s,@PWD@,${pwd},g" \ -e "s,@CC@,${CC},g" \ -e "s,@LD@,${LD},g" \ @@ -1794,6 +1823,9 @@ manual-ztxt: manual-zip: \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-zip +features: + \$(SILENT)\$(MAKE) -C \$(APPSDIR) OBJDIR=\$(BUILDDIR)/@APPS@ features + help: @echo "A few helpful make targets" @echo "" @@ -1832,10 +1864,9 @@ if [ "yes" = "$voice" ]; then cat >> Makefile <