1
0
Fork 0
forked from len0rd/rockbox

Voice-building changes: Ask for which eSpeak voice to use for some languages. Please test and report if you have any

problems. If you automatically build eSpeak voices, you'll have to update your script.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16271 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonas Häggqvist 2008-02-10 17:20:06 +00:00
parent c7559753ce
commit 85f371edb5

86
tools/configure vendored
View file

@ -337,6 +337,23 @@ whichadvanced () {
fi
}
getespeakopts () {
langcode=$1
i=1
espeak --voices=$langcode |grep -v ^Pty | sed -e 's/ \+/ /g' |(while read line; do
IFS=" "
echo $line| (read pty lang agegender voicename file otherlangs
printf "%2d. %s (%s)\n" $i "$voicename" "$agegender"
)
i=`expr $i + 1`
done)
printf "Which voice should be used [1]?: "
read reply
if [ "$reply" = "" ]; then reply=1; fi
VOICE=`espeak --voices=$langcode |head -n \`expr $reply + 1\` |tail -n 1 |sed -e 's/ \+/ /g' -e 's/ *[^\ ]\+ [^\ ]\+ [^\ ]\+ \([^\ ]\+\).*/\1/'`
ESPEAK_OPTS="-v $VOICE"
}
# Configure voice settings
voiceconfig () {
thislang=$1
@ -441,6 +458,75 @@ voiceconfig () {
esac
echo "Using $TTS_ENGINE for TTS"
if [ "$TTS_ENGINE" = "espeak" ]; then
case "$thislang" in
"afrikaans")
getespeakopts "af"
;;
chinese-*)
getespeakopts "zh"
;;
"czech")
getespeakopts "cs"
;;
"deutsch")
getespeakopts "de"
;;
"greek")
getespeakopts "el"
;;
"english")
getespeakopts "en"
;;
"esperanto")
getespeakopts "eo"
;;
"espanol")
getespeakopts "es"
;;
"finnish")
getespeakopts "fi"
;;
"francais")
getespeakopts "fr"
;;
"hindi")
getespeakopts "hi"
;;
"islenska")
getespeakopts "is"
;;
"italiano")
getespeakopts "it"
;;
"nederlands")
getespeakopts "nl"
;;
"norsk")
getespeakopts "no"
;;
"polski")
getespeakopts "pl"
;;
portugues*)
getespeakopts "pt"
;;
"romaneste")
getespeakopts "ro"
;;
"russian")
getespeakopts "ru"
;;
"svenska")
getespeakopts "sv"
;;
*)
ESPEAK_OPTS=""
;;
esac
TTS_OPTS="${TTS_OPTS}${ESPEAK_OPTS}"
fi
# Allow the user to input manual commandline options
printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): "
USER_TTS_OPTS=`input`