diff options
-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); |