Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOUND] speechd lets your Computer speak
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4, 5, 6  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Tobi 2.4.20
n00b
n00b


Joined: 27 Mar 2003
Posts: 11
Location: Düsseldorf, Germany, Earth

PostPosted: Sat Mar 29, 2003 5:31 pm    Post subject: [SOUND] speechd lets your Computer speak Reply with quote

Hi!
This is how I set up speechd:

1. Become root
Code:
# su -

2. emerge needed Packages
Code:
# emerge speechd

3. Init-Script:
Code:
# vi /etc/init.d/speechd

and fill with:
Code:
#!/sbin/runscript
 
start() {
        ebegin "Starting speechd"
        start-stop-daemon --start --quiet --pidfile /var/run/speechd.pid --exec
/usr/bin/speechd
        eend $? "Failed to start speechdd"
}
 
stop() {
        ebegin "Stopping speechd"
        start-stop-daemon --stop --quiet --pidfile /var/run/speechd.pid
        eend $? "Failed to stop speechd"
 
        # clean stale pidfile
        [ -f /var/run/speechd.pid ] && rm -f /var/run/speechd.pid
}
 
restart() {
        stop
        start
}

4. make init-script executable
Code:
# chmod 755 /etc/init.d/speechd

5. if you want to come up speechd at boottime type:
Code:
# rc-update add speechd default

6. start speechd
Code:
# /etc/init.d/speechd start

7. Test:
Code:
# echo "Hello World" > /dev/speech


This works for me, and it's fun! I think the init-script isn't perfect, if anybody could post a better one, I would be happy.

For those of you who would like to hear a female voice, follow these additional steps:

8. emerge needed packages
Code:
# emerge mbrola

9. edit the voices scheme
Code:
# vi /usr/lib/festival/voices.scm

10. search for "us1_mbrola" and put it in top of the list and save the file.
Before:
Code:

'(kal_diphone
    ked_diphone
    don_diphone
    rab_diphone
    en1_mbrola
    us1_mbrola
    us2_mbrola
    us3_mbrola
    gsw_diphone  ;; not publically distributed
    el_diphone)

After:
Code:

'(us1_mbrola
    kal_diphone
    ked_diphone
    don_diphone
    rab_diphone
    en1_mbrola
    us2_mbrola
    us3_mbrola
    gsw_diphone  ;; not publically distributed
    el_diphone)

11. Test female:
Code:
# echo "(SayText \"Hello World\")" | festival

(Note: #echo "Hello World" > /dev/speech will not work for female voice!)

That's it so far...

See ya, Tobi
_________________
Scientists tell us that the fastest animal on earth, with a top speed of 120 feet/second, is a cow that has been dropped out of a helicopter.
-Dave Barry


Last edited by Tobi 2.4.20 on Fri Apr 04, 2003 10:51 am; edited 3 times in total
Back to top
View user's profile Send private message
bsolar
Bodhisattva
Bodhisattva


Joined: 12 Jan 2003
Posts: 2764

PostPosted: Sat Mar 29, 2003 5:47 pm    Post subject: Reply with quote

You might want to commit that to bugzilla. :wink:
_________________
I may not agree with what you say, but I'll defend to the death your right to say it.
Back to top
View user's profile Send private message
Ivion
n00b
n00b


Joined: 23 Jan 2003
Posts: 45
Location: Amsterdam

PostPosted: Sat Mar 29, 2003 8:53 pm    Post subject: Reply with quote

Is there also a way to let the 'voice' sound different? Like changing it to a woman's voice? :)
Back to top
View user's profile Send private message
barlad
l33t
l33t


Joined: 22 Feb 2003
Posts: 673

PostPosted: Sat Mar 29, 2003 10:35 pm    Post subject: Reply with quote

I can't seem to be able to load festival in server mode to have speechd workds... keeping getting a "bind failed" error :(

I think you can change the voice in Festival btw
Back to top
View user's profile Send private message
Tobi 2.4.20
n00b
n00b


Joined: 27 Mar 2003
Posts: 11
Location: Düsseldorf, Germany, Earth

PostPosted: Sun Mar 30, 2003 11:32 am    Post subject: Reply with quote

bsolar wrote:
You might want to commit that to bugzilla. :wink:

Do you mean the init-script? I've written it by myself and I'm not sure if it's ok, or not.
_________________
Scientists tell us that the fastest animal on earth, with a top speed of 120 feet/second, is a cow that has been dropped out of a helicopter.
-Dave Barry
Back to top
View user's profile Send private message
Ante
n00b
n00b


Joined: 28 Dec 2002
Posts: 14
Location: 127.0.0.1

PostPosted: Sun Mar 30, 2003 6:02 pm    Post subject: Reply with quote

Damn, this is hot :D Extremley funny, gonna add this to my /etc/init.d/issue.
As mentioned, is it possible to change to voice?

EDIT: echo "Welcome to this Gentoo/Linux box of power, feel free to enjoy your self" > /dev/speech
_________________
Why?
Back to top
View user's profile Send private message
Vagabond
Apprentice
Apprentice


Joined: 19 Jan 2003
Posts: 192

PostPosted: Sun Mar 30, 2003 7:46 pm    Post subject: Reply with quote

Hmm, I can't get speechd to talk by echoing to /dev/speech but I can get festival to manually speak by using (SayTest "blah") after initalizing festival.

Any ideas?

Vag
Back to top
View user's profile Send private message
barlad
l33t
l33t


Joined: 22 Feb 2003
Posts: 673

PostPosted: Sun Mar 30, 2003 7:53 pm    Post subject: Reply with quote

Ya, check /var/log/speechd.
Most likely, it will tell you that it cannot connect to festival server.
Then stop the speechd service, try to run
Code:
festival --server

See if it works, then run speechd again. It should work. If it does not, check again /var/log/speechd and see what's wrong.

Right now I can't run the festival server, it says something like "binding failed". I think there is something to set up somewhere so festival is allowed to use port 1034 and speechd is allowed to connect to it.
If you find... let me know please ;)
Back to top
View user's profile Send private message
Vagabond
Apprentice
Apprentice


Joined: 19 Jan 2003
Posts: 192

PostPosted: Sun Mar 30, 2003 8:18 pm    Post subject: Reply with quote

Yeah, I get the same error, damn.

Vag
Back to top
View user's profile Send private message
link97381
n00b
n00b


Joined: 29 Mar 2003
Posts: 34
Location: Silverton Oregon

PostPosted: Mon Mar 31, 2003 1:29 pm    Post subject: Reply with quote

Ya I get a "socket: bind failed" error.....anyone know how to fix it?
Back to top
View user's profile Send private message
Lockup
Guru
Guru


Joined: 25 Jul 2002
Posts: 430

PostPosted: Mon Mar 31, 2003 1:34 pm    Post subject: Reply with quote

if only we could use the at&t voices with that...
Back to top
View user's profile Send private message
Tobi 2.4.20
n00b
n00b


Joined: 27 Mar 2003
Posts: 11
Location: Düsseldorf, Germany, Earth

PostPosted: Mon Mar 31, 2003 6:30 pm    Post subject: Reply with quote

Ante wrote:
Damn, this is hot :D Extremley funny, gonna add this to my /etc/init.d/issue.
As mentioned, is it possible to change to voice?

EDIT: echo "Welcome to this Gentoo/Linux box of power, feel free to enjoy your self" > /dev/speech

Hi dudes!

I've added a method how to let your computer speak like your girlfriend...just follow steps eight to ten!

See ya, Tobi
_________________
Scientists tell us that the fastest animal on earth, with a top speed of 120 feet/second, is a cow that has been dropped out of a helicopter.
-Dave Barry
Back to top
View user's profile Send private message
TheCoop
Veteran
Veteran


Joined: 15 Jun 2002
Posts: 1814
Location: Where you least expect it

PostPosted: Mon Mar 31, 2003 8:34 pm    Post subject: Reply with quote

that is absolutly wonderful, thankyou, how about including the rc script in the ebuild?
_________________
95% of all computer errors occur between chair and keyboard (TM)

"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler

Change the world - move a rock
Back to top
View user's profile Send private message
Tobi 2.4.20
n00b
n00b


Joined: 27 Mar 2003
Posts: 11
Location: Düsseldorf, Germany, Earth

PostPosted: Tue Apr 01, 2003 6:07 am    Post subject: Reply with quote

TheCoop wrote:
that is absolutly wonderful, thankyou, how about including the rc script in the ebuild?

How do I do this? Is their any HowTo, man-page, whatever where ebuild-hacking is explained?
And: I think the script isn't quiet perfect, e.g. when you make # /etc/init.d/speechd restart their is some curious error I can't cope with.
_________________
Scientists tell us that the fastest animal on earth, with a top speed of 120 feet/second, is a cow that has been dropped out of a helicopter.
-Dave Barry
Back to top
View user's profile Send private message
bassvandijk
Guru
Guru


Joined: 13 Sep 2002
Posts: 306
Location: Haps, Netherlands

PostPosted: Wed Apr 02, 2003 6:01 pm    Post subject: Reply with quote

This is really cool!!!

Also nice:

forune > /dev/speech
or
dmesg > /dev/speech
Back to top
View user's profile Send private message
bassvandijk
Guru
Guru


Joined: 13 Sep 2002
Posts: 306
Location: Haps, Netherlands

PostPosted: Wed Apr 02, 2003 7:08 pm    Post subject: Reply with quote

I have a weird problem:

When I do:
echo "Hello world" > /dev/speech

festival says "Hello world" but it says it way too fast.
Like playing a LP too fast...
Back to top
View user's profile Send private message
bassvandijk
Guru
Guru


Joined: 13 Sep 2002
Posts: 306
Location: Haps, Netherlands

PostPosted: Thu Apr 03, 2003 12:33 pm    Post subject: Reply with quote

I solved the problem!

http://www.cstr.ed.ac.uk/cgi-bin/lists.cgi?config=festival_faq&entry=arunning_festival/speed.html
Back to top
View user's profile Send private message
bassvandijk
Guru
Guru


Joined: 13 Sep 2002
Posts: 306
Location: Haps, Netherlands

PostPosted: Thu Apr 03, 2003 6:39 pm    Post subject: Reply with quote

If you rc-update this script to your default runlevel then your computer will greet you while booting and it will say goodbey when you halt.

Of course you will need the speechd rc-script also.

If you don't have fortune then just cut the fortune line out.

audio_message
Code:

#!/sbin/runscript

#
# rc-script to let your gentoo-box speak at boot or halt time.
#
# Bas van Dijk basvandijk@home.nl
#

depend() {
        need speechd
}

start() {
        ebegin "Playing login audio message"

        date="$(date +%H)"
        user="$(whoami)"

        if [ "$date" -ge "6" -a "$date" -le "12" ]
        then
                say "Good morning $user"
        else
                if [ "$date" -gt "12" -a "$date" -le "18" ]
                then
                        say "Good afternoon $user"
                else
                        if [ "$date" -gt "18" -a "$date" -le "24" ]
                        then
                                say "Good evening $user"
                        else
                                if [ "$date" -gt "0" -a "$date" -lt "6" ]
                                then
                                        say "What are you doing up so late $user"
                                fi
                        fi
                fi
        fi
        say "Please pay attention to a few words of wisdom..."
        say "$(fortune)"
}

stop() {
        ebegin "Playing logout audio message"

        say "Thank you for using Gentoo Linux."
        say "Good by and farewell $(whoami)."
}



You will also need to this bash script:
/bin/say
Code:

#/bin/bash

if [ -e "/dev/speech" ]
then
    echo "$1"
    echo "$1" > /dev/speech
else
    echo "Error! speechd not loaded!"
fi


BTW:
In the speechd script, festival doesn't get closed while stopping the service. So you will need to put a killall festival in the stop() function.
Back to top
View user's profile Send private message
pubecon
Guru
Guru


Joined: 03 Mar 2003
Posts: 342
Location: Glasgow, Scotland

PostPosted: Mon Apr 07, 2003 6:41 pm    Post subject: Reply with quote

so how do you set up the festival server so you don't get the binding error?
Back to top
View user's profile Send private message
papabean
Tux's lil' helper
Tux's lil' helper


Joined: 26 Oct 2002
Posts: 130
Location: Sacramento, California

PostPosted: Mon Apr 07, 2003 11:14 pm    Post subject: Reply with quote

I couldn't get redirection to /dev/speech working for me without sounding like a chipmunk on methamphetamines, but what did work after following the directions above was this:
Code:
echo "Hello World" | festival --tts -

or:
Code:
fortune | festival --tts -


Hope this helps anyone else.
_________________
-- The world is full of tough guys. It doesn't need me to be one too.


Last edited by papabean on Mon Apr 07, 2003 11:25 pm; edited 1 time in total
Back to top
View user's profile Send private message
Chewie
n00b
n00b


Joined: 02 Apr 2003
Posts: 26
Location: Sweden, Boras

PostPosted: Mon Apr 07, 2003 11:24 pm    Post subject: Reply with quote

Hehe this is really cool, thanks dude. :D
Back to top
View user's profile Send private message
Yinchie
Apprentice
Apprentice


Joined: 05 Mar 2003
Posts: 179
Location: The Netherlands

PostPosted: Tue Apr 08, 2003 12:33 am    Post subject: Reply with quote

bassvandijk wrote:
If you rc-update this script to your default runlevel then your computer will greet you while booting and it will say goodbey when you halt.

Of course you will need the speechd rc-script also.

If you don't have fortune then just cut the fortune line out.

....................

BTW:
In the speechd script, festival doesn't get closed while stopping the service. So you will need to put a killall festival in the stop() function.


Kewl, thanks for this.
Going to try this out! :D
Back to top
View user's profile Send private message
Ian
l33t
l33t


Joined: 28 Oct 2002
Posts: 834
Location: Somerville, MA

PostPosted: Tue Apr 08, 2003 1:33 am    Post subject: Reply with quote

bassvandijk wrote:
I solved the problem!

http://www.cstr.ed.ac.uk/cgi-bin/lists.cgi?config=festival_faq&entry=arunning_festival/speed.html


it says to change a file in "festival/lib" but i have one problem :)

can someone tell me where festival/lib is? heh, i know it probably sounds stupid, but i got everything to work (including the login/logout scripts), except that it's all highpitched/doublespeed.

i must say, even though this is the last thing i ever needed for my home server/linux experiment computer, it's probably the damn coolest thing on the computer :P.

one slight problem i noticed with the stop script to say goodbye when halting, it takes long enough that speechd cannot be shutdown. i'm not sure if this is a problem, or if there's a way to pause the shutdown for a few seconds, so it can shutdown speechd correctly, but that's one thing that should probably be considered. then again, it might not matter, i'm not sure.
Back to top
View user's profile Send private message
papabean
Tux's lil' helper
Tux's lil' helper


Joined: 26 Oct 2002
Posts: 130
Location: Sacramento, California

PostPosted: Tue Apr 08, 2003 6:31 am    Post subject: Reply with quote

Ian wrote:
it says to change a file in "festival/lib" but i have one problem :)

can someone tell me where festival/lib is? heh, i know it probably sounds stupid, but i got everything to work (including the login/logout scripts), except that it's all highpitched/doublespeed.


Sure. It's located in /usr/lib/festival/. I had to create the siteinit.scm file manually and emerge sox, but it works wonderfully now.
_________________
-- The world is full of tough guys. It doesn't need me to be one too.
Back to top
View user's profile Send private message
Gnufsh
Guru
Guru


Joined: 28 Dec 2002
Posts: 400
Location: Portland, OR

PostPosted: Tue Apr 08, 2003 11:37 am    Post subject: Reply with quote

For some reason I get this:
# /etc/init.d/speechd start
* ERROR: "/etc/init.d/speechd" has syntax errors in it; not executing...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3, 4, 5, 6  Next
Page 1 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum