espeak is a really great software, and easier to use than festival or mbrola... I use it with lame to convert my ebooks to mp3, so i can hear them as audiobooks on the school bus...
Here is a small script I made to make the process easier:
Code:
#!/bin/sh
# txt2mp3 - convert text files to mp3 audio files (aka audiobooks)
# v0.1
#
# (c) 2008 Everthon Valadão <everthonvaladao@gmail.com> under the GPL
# http://www.gnu.org/copyleft/gpl.html
#
# OBS.: install some pre-requisites first, with
# sudo apt-get install espeak lame xpdf-utils odt2txt antiword
TXT_FILE="$1"
BASENAME=`echo "$TXT_FILE" | sed 's/\(.*\)\(\....$\)/\1/g'`
echo "TTS (text-to-speach) ${TXT_FILE}"
ext=${1##*.}
# if it isn't a TXT file, convert it first
if [ "$ext" != "txt" ] ; then
TMP_FILE="/tmp/espeakfile-$$.txt"
# PDF
if [ "$ext" = "pdf" ] ; then
echo "converting from PDF to TXT"
pdftotext "${TXT_FILE}" "${TMP_FILE}"
fi
# ODT
if [ "$ext" = "odt" ] ; then
echo "converting from ODT to TXT"
odt2txt --subst=all "${TXT_FILE}" > "${TMP_FILE}"
fi
# DOC
if [ "$ext" = "doc" ] ; then
echo "converting from DOC to TXT"
antiword "${TXT_FILE}" > "${TMP_FILE}"
fi
TXT_FILE="${TMP_FILE}"
fi
rm -f /tmp/voice.wav
# create a FIFO "named pipe" to save space
mkfifo /tmp/voice.wav
# espeak write output to a pipe while lame encodes the file on the fly
nice espeak -f "${TXT_FILE}" -w /tmp/voice.wav & \
xterm -e nice lame -a --resample 16 -V 9 --vbr-new --lowpass 8 -f /tmp/voice.wav -o "${BASENAME}_VBR.mp3"
echo "...done! Voice saved as ${1}.mp3"
source: txt2mp3 - Como converter eBooks pra audioBooks
P.S.: epseak supports a lot of languages other than english, as you can check with `espeak --voices`
P.S.2: se você fala português como eu, pode adicionar um argumento ao espeak para utilizar uma voz na nossa língua pátria:
Code:
nice espeak -v brazil+f3 -p 25 -f "${TXT_FILE}" -w /tmp/voice.wav & \
no início é um pouco esquisito, mas com pouco tempo você se acostuma e passa a entender tudo ^^
Bookmarks