Festival has a Sable XML DTD you can use to adjust the speed of
utterances, but it doesn't seem to adjust the lengths of pauses.  The
default speech speed is far too slow for pleasant use.  Here's a
little hack to speed up text-to-speech output a bit, with little
leftover bits in the middle to try to use Sable.

#!/bin/sh
pipe="/tmp/$$.sable"
rm -f "$pipe"
mkfifo "$pipe"
time text2wave -o "$pipe.wav" "$pipe" &
#cat "$pipe" &
(cat <<EOF
<?xml version="1.0"?>
<!DOCTYPE SABLE PUBLIC "-//SABLE//DTD SABLE speech mark up//EN"
      "Sable.v0_2.dtd"
[]>
     <SABLE>
     <SPEAKER NAME="male1">
<!-- <RATE SPEED="-25%"><PITCH BASE="-50%"> -->
EOF
cat "$@" | perl -pe 's/&/&amp;/g; s/</&lt/g; s/"/&quot;/g; s/'\''/&apos;/g'
cat <<EOF
<!-- </PITCH></RATE> -->
      </SPEAKER>
     </SABLE>
EOF
) > "$pipe"
wait
rm -f "$pipe"
mplayer -speed 2 "$pipe.wav"
rm -f "$pipe.wav"

Reply via email to