Search This Blog

Showing posts with label festival voice. Show all posts
Showing posts with label festival voice. Show all posts

Sunday, August 7, 2011

Festival and setting voice to female

First you need to install festival package

# aptitude install festival festival-freebsoft-utils


In a terminal:

Test festival:
# echo "Hello World"| festival --tts

To copy to wav:
# echo "Hello World" | text2wave -o Hello_World.wav

To read man pages of cron:
#man cron | festival --tts

To read a saved file:
#festival --tts snort-usage.odt

To change voice to a female:

#cd /usr/share/festival/voices/english

#wget http://festvox.org/packed/festival/latest/festvox_cmu_us_slt_arctic_hts.tar.gz
#tar xvf festvox_cmu_us_slt_arctic_hts.tar.gz
#mv festival/lib/voices/us/cmu_us_slt_arctic_hts .

Check if the female voice is loading

#festival
Festival Speech Synthesis System 1.95:beta July 2004
Copyright (C) University of Edinburgh, 1996-2004. All rights reserved.
For details type `(festival_warranty)'
festival> (voice_cmu_us_slt_arctic_hts)    <== Set Voice
 cmu_us_slt_arctic_hts
festival> (SayText "this is a test text for demo") <== Hear the voice
 #<Utterance 0xb7216598>
festival> 
If it works,
PHPAGI for asterisk uses text2wave which is a script based on Festival.

text2wave can be set to the voice using
#text2wave -eval "(voice_cmu_us_slt_arctic_hts)"

so a wrapper script is created in /usr/local/bin/text2wave
#!/bin/bash
/usr/bin/text2wave -eval "(voice_cmu_us_slt_arctic_hts)" "$@"

this script will give sometimes "Segmentation fault"
so a replacement of text2wave is taken from http://trantrietvn.blogspot.com/2011/08/fix-bug-segmentation-fault-text2wave.html
and copied to /usr/bin
(this one is bug-fixed version)

You have a successfully change the voice!