summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJonas Häggqvist <rasher@rasher.dk>2009-03-02 21:36:48 +0000
committerJonas Häggqvist <rasher@rasher.dk>2009-03-02 21:36:48 +0000
commit839bcdf46c2a6a269931cc9d3cc39cf45cc21a3b (patch)
treed538211ab4d1dd82c5eefe29a6a8dabb147ff149 /tools
parent22b925495a130325538812807f7b75d40f9ee5f5 (diff)
downloadrockbox-839bcdf46c2a6a269931cc9d3cc39cf45cc21a3b.tar.gz
rockbox-839bcdf46c2a6a269931cc9d3cc39cf45cc21a3b.tar.bz2
rockbox-839bcdf46c2a6a269931cc9d3cc39cf45cc21a3b.zip
Ask which voice to use for Festival.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20181 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rwxr-xr-xtools/configure23
-rwxr-xr-xtools/voice.pl4
2 files changed, 27 insertions, 0 deletions
diff --git a/tools/configure b/tools/configure
index 04d8e8d93f..b689e9b18a 100755
--- a/tools/configure
+++ b/tools/configure
@@ -526,6 +526,29 @@ voiceconfig () {
esac
echo "Using $TTS_ENGINE for TTS"
+ # Select which voice to use for Festival
+ if [ "$TTS_ENGINE" = "festival" ]; then
+ i=1
+ for voice in `echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1 foobar/'|sort`; do
+ if [ "$i" = "1" ]; then
+ TTS_FESTIVAL_VOICE="$voice" # Default choice
+ fi
+ printf "%3d. %s\n" "$i" "$voice"
+ i=`expr $i + 1`
+ done
+ printf "Please select which Festival voice to use (default is $TTS_FESTIVAL_VOICE): "
+ CHOICE=`input`
+ i=1
+ for voice in `echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1 foobar/'|sort`; do
+ if [ "$i" = "$CHOICE" -o "$voice" = "$CHOICE" ]; then
+ TTS_FESTIVAL_VOICE="$voice"
+ fi
+ i=`expr $i + 1`
+ done
+ echo "Festival voice set to $TTS_FESTIVAL_VOICE"
+ echo "(voice_$TTS_FESTIVAL_VOICE)" > festival-prolog.scm
+ fi
+
# Allow the user to input manual commandline options
printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): "
USER_TTS_OPTS=`input`
diff --git a/tools/voice.pl b/tools/voice.pl
index ac7a1b13cd..21c9ab913c 100755
--- a/tools/voice.pl
+++ b/tools/voice.pl
@@ -245,6 +245,10 @@ sub voicestring {
# festival_client lies to us, so we have to do awful soul-eating
# work with IPC::open3()
$cmd = "festival_client --server localhost --otype riff --ttw --output \"$output\"";
+ # Use festival-prolog.scm if it's there (created by user of tools/configure)
+ if (-f "festival-prolog.scm") {
+ $cmd .= " --prolog festival-prolog.scm";
+ }
print("> $cmd\n") if $verbose;
# Open command, and filehandles for STDIN, STDOUT, STDERR
my $pid = open3(*CMD_IN, *CMD_OUT, *CMD_ERR, $cmd);