User avatar
hiddenotebook
Posts: 68
Joined: Fri Oct 02, 2015 7:52 pm
Contact: Website

Make Raspberry to talk with Festival [tutorial] NEW VOICE

Mon Oct 05, 2015 9:36 am

THE NEW VOICE IS THE LAST MESSAGE

How to make Raspberry Pi2 Raspbian to talk with Festival.

Install festival.

Code: Select all

sudo apt-get -y install festival
To tell our Raspi to use 3,5 Jack audio output.

Code: Select all

amixer cset numid=3 1
Plug in speakers or headphones and type: 'echo "Hi dude, how can I help you?" | festival --tts' This will make festival to say everything between “” thingies.

Code: Select all

echo "Hi dude, how can I help you?" | festival --tts
You can pipe other things to festival if you end your lines with | festival -–tts example your computer hostname:

Code: Select all

hostname | festival --tts
To read the contents of a text document in /home/pi for example 'file' just type.

Code: Select all

festival --tts "file"
Tell the date:

Code: Select all

date "+%H:%M %P %A %d %B %Y"| festival --tts
Read some selected text with a shortcut.

We need an application to aloud us pipe the text from Internet to festival 'xsel'

Code: Select all

sudo apt-get install xsel
Make a bash script to do the job with cat

Code: Select all

cat << eof > talk.sh
#!/bin/bash
xsel | festival --tts --pipe
eof
Permissions to execute for the file talk.sh

Code: Select all

chmod +x talk.sh
Now we need to manage the shortcuts. In Raspian this is done by editing:

Code: Select all

~/.config/openbox/lxde-pi-rc.xml
From command line type:

Code: Select all

nano ~/.config/openbox/lxde-pi-rc.xml
Under the <keyboard> tag add:

Code: Select all

<keybind key= "Name of key">
    <action name= "Execute">
        <execute>Command name</execute>
    </action>
</keybind>
Then you can complete the fields like this:

Code: Select all

<!--Keybindings for Festival -->
<keybind key= "C-Menu">
    <action name= "Execute">
        <execute>/home/pi/talk.sh</execute>
    </action>
</keybind>
That's all, from now you can read text with festival just selecting some text and puss the combo Control+Menu, you may need to reboot.

If you are wondering what happens when you push a button use the command 'xev' in terminal when you press a key, the shell will tell his name then you can use it to make the shortcuts.

Of course you can run festival with 'festival' command an read things.

Run festival.

Code: Select all

festival 
Say something.

Code: Select all

(Saytext "Hello world")
Read a file.

Code: Select all

(tts "file" nil)
Get out of festival.

Code: Select all

(quit)
Sorry for my English I still learning your great language! have fun and talk with your raspy :)
I take this opportunity to ask you to share your progress with festival, let's make this topic a great post.

I'm working on handling the raspberry with voice commands, and answer me via julius. I'm sure many people would like the idea, let's work together.

see you!!

source: My place (with pics)
Last edited by hiddenotebook on Sat Sep 10, 2016 11:26 pm, edited 4 times in total.

User avatar
hiddenotebook
Posts: 68
Joined: Fri Oct 02, 2015 7:52 pm
Contact: Website

Re: Make Raspberry to talk with Festival [tutorial]

Sun Oct 11, 2015 10:19 pm

A few days playing with festival and I bring my progress.

Install some voices us1_mbrola famale voice included!

sudo apt-get install festival festival-freebsoft-utils festlex-oald

sudo apt-get install festvox-kallpc16k festvox-kdlpc16k festvox-rablpc16k

mkdir /tmp/mbrola

cd /tmp/mbrola

wget http://www.tcts.fpms.ac.be/synthesis/mb ... mbrola.tgz

wget http://tcts.fpms.ac.be/synthesis/mbrola ... 980512.zip

wget http://tcts.fpms.ac.be/synthesis/mbrola ... 980910.zip

tar -xzvf mbrola.tgz

sudo mv mbrola /usr/bin

rm mbrola.tgz

unzip us1-980512.zip

unzip en1-980910.zip

sudo mkdir -p /usr/share/festival/voices/english/us1_mbrola/

sudo mkdir -p /usr/share/festival/voices/english/en1_mbrola/

sudo mv us1 /usr/share/festival/voices/english/us1_mbrola/

sudo mv en1 /usr/share/festival/voices/english/en1_mbrola/

wget http://www.festvox.org/packed/festival/ ... us1.tar.gz

tar -xzvf festvox_us1.tar.gz

sudo mv festival/lib/voices/english/us1_mbrola/* /usr/share/festival/voices/english/us1_mbrola/

wget http://www.festvox.org/packed/festival/ ... en1.tar.gz

tar -xzvf festvox_en1.tar.gz

sudo mv festival/lib/voices/english/en1_mbrola/* /usr/share/festival/voices/english/en1_mbrola/

rm festvox_en1.tar.gz

rm -rf festival

amixer cset numid=3 1

To set a dafault voice type:

sudo nano /etc/festival.scm

add this line:

(set! voice_default 'voice_us1_mbrola)

enjoy :)

User avatar
hiddenotebook
Posts: 68
Joined: Fri Oct 02, 2015 7:52 pm
Contact: Website

great and clear famale voice for festival

Sat Sep 10, 2016 11:14 pm

I update this post today because I find a great female voice. I have more so if you like I can share :arrow:

Make a directory to do the job:

Code: Select all

mkdir myvoice  
cd myvoice  
Download this great and clear voice:

Code: Select all

wget http://www.speech.cs.cmu.edu/cmu_arctic/packed/cmu_us_slt_arctic-0.95-release.tar.bz2  
Extract it:

Code: Select all

tar xf cmu_us_slt_arctic-0.95-release.tar.bz2 
Now move it to festival. Beware, we need to change the name here add _clunits suffix ok:

Code: Select all

sudo mv cmu_us_slt_arctic /usr/share/festival/voices/english/cmu_us_slt_arctic_clunits  
Make it the default voice : edit festival config file add this to a new line (/etc/festival*.scm)

Code: Select all

(set! voice_default 'voice_cmu_us_slt_arctic_clunits)  
Now start festival:

Code: Select all

festival
Test it:

Code: Select all

(SayText "Hello I am Alice, and i'm nice. This is a short introduction test.")
Your Welcome guys for this great girl

masterkenobi
Posts: 2
Joined: Sun May 22, 2016 3:49 am

Re: Make Raspberry to talk with Festival [tutorial] NEW VOICE

Tue Apr 17, 2018 10:12 am

after i set this...

(set! voice_default 'voice_cmu_us_slt_arctic_clunits)

I see this error.

Code: Select all

-=-=-=-=-=- EST Error -=-=-=-=-=-
{FND} Feature Token_Method not defined

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

User avatar
hiddenotebook
Posts: 68
Joined: Fri Oct 02, 2015 7:52 pm
Contact: Website

Re: Make Raspberry to talk with Festival [tutorial] NEW VOICE

Tue Apr 17, 2018 12:09 pm

Check the folder voice name sould be cmu_us_slt_arctic_clunits if doesn't work there are 2 possibility one the name of the folder or the incompatibility with other voices

Good luck!

Return to “Advanced users”