diff options
author | Jonas Häggqvist <rasher@rasher.dk> | 2009-03-02 21:36:48 +0000 |
---|---|---|
committer | Jonas Häggqvist <rasher@rasher.dk> | 2009-03-02 21:36:48 +0000 |
commit | 839bcdf46c2a6a269931cc9d3cc39cf45cc21a3b (patch) | |
tree | d538211ab4d1dd82c5eefe29a6a8dabb147ff149 /tools | |
parent | 22b925495a130325538812807f7b75d40f9ee5f5 (diff) | |
download | rockbox-839bcdf46c2a6a269931cc9d3cc39cf45cc21a3b.tar.gz 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-x | tools/configure | 23 | ||||
-rwxr-xr-x | tools/voice.pl | 4 |
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 () { | |||
526 | esac | 526 | esac |
527 | echo "Using $TTS_ENGINE for TTS" | 527 | echo "Using $TTS_ENGINE for TTS" |
528 | 528 | ||
529 | # Select which voice to use for Festival | ||
530 | if [ "$TTS_ENGINE" = "festival" ]; then | ||
531 | i=1 | ||
532 | for voice in `echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1 foobar/'|sort`; do | ||
533 | if [ "$i" = "1" ]; then | ||
534 | TTS_FESTIVAL_VOICE="$voice" # Default choice | ||
535 | fi | ||
536 | printf "%3d. %s\n" "$i" "$voice" | ||
537 | i=`expr $i + 1` | ||
538 | done | ||
539 | printf "Please select which Festival voice to use (default is $TTS_FESTIVAL_VOICE): " | ||
540 | CHOICE=`input` | ||
541 | i=1 | ||
542 | for voice in `echo "(voice.list)"|festival -i 2>/dev/null |tr "\n" " "|sed -e 's/.*festival> (\(.*\)) festival>/\1 foobar/'|sort`; do | ||
543 | if [ "$i" = "$CHOICE" -o "$voice" = "$CHOICE" ]; then | ||
544 | TTS_FESTIVAL_VOICE="$voice" | ||
545 | fi | ||
546 | i=`expr $i + 1` | ||
547 | done | ||
548 | echo "Festival voice set to $TTS_FESTIVAL_VOICE" | ||
549 | echo "(voice_$TTS_FESTIVAL_VOICE)" > festival-prolog.scm | ||
550 | fi | ||
551 | |||
529 | # Allow the user to input manual commandline options | 552 | # Allow the user to input manual commandline options |
530 | printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): " | 553 | printf "Enter $TTS_ENGINE options (enter for defaults \"$TTS_OPTS\"): " |
531 | USER_TTS_OPTS=`input` | 554 | 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 { | |||
245 | # festival_client lies to us, so we have to do awful soul-eating | 245 | # festival_client lies to us, so we have to do awful soul-eating |
246 | # work with IPC::open3() | 246 | # work with IPC::open3() |
247 | $cmd = "festival_client --server localhost --otype riff --ttw --output \"$output\""; | 247 | $cmd = "festival_client --server localhost --otype riff --ttw --output \"$output\""; |
248 | # Use festival-prolog.scm if it's there (created by user of tools/configure) | ||
249 | if (-f "festival-prolog.scm") { | ||
250 | $cmd .= " --prolog festival-prolog.scm"; | ||
251 | } | ||
248 | print("> $cmd\n") if $verbose; | 252 | print("> $cmd\n") if $verbose; |
249 | # Open command, and filehandles for STDIN, STDOUT, STDERR | 253 | # Open command, and filehandles for STDIN, STDOUT, STDERR |
250 | my $pid = open3(*CMD_IN, *CMD_OUT, *CMD_ERR, $cmd); | 254 | my $pid = open3(*CMD_IN, *CMD_OUT, *CMD_ERR, $cmd); |