Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

[SOUND] speechd lets your Computer speak

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
136 posts
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next
Author
Message
panserg
Apprentice
Apprentice
User avatar
Posts: 188
Joined: Wed Apr 16, 2003 7:10 pm

  • Quote

Post by panserg » Fri May 09, 2003 2:27 pm

BradB wrote:could you hook it up so that kernel logs got spoken out?
Probably annoying, but maybe fun :)
I've hooked to speak the Subject and From fields for all my incoming email. But make sure you do it AFTER you filter spam out :)
Top
riggagoogoo
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 108
Joined: Sun Apr 06, 2003 4:44 pm

  • Quote

Post by riggagoogoo » Wed May 14, 2003 10:20 am

I've hooked to speak the Subject and From fields for all my incoming email. But make sure you do it AFTER you filter spam out
How did you do this???
Top
panserg
Apprentice
Apprentice
User avatar
Posts: 188
Joined: Wed Apr 16, 2003 7:10 pm

  • Quote

Post by panserg » Wed May 14, 2003 3:14 pm

riggagoogoo wrote:
I've hooked to speak the Subject and From fields for all my incoming email. But make sure you do it AFTER you filter spam out
How did you do this???
Do you know procmail or maildrop or any mail-filtering program?

The idea is that when it is filtering a message, it remembers Subject and From (and/or other) fields in variables and then calling a simple shell script with arguments from those variables. The shell script takes arguments, formats the final text message based on stings from arguments and pass it to festival.

A mail filter script is very specific to mail-filtering program you use. It's also specific to what exactly you are doing when filtering your messages. The shell script is specific to what final output do you want to hear.

I had it before with procmail/sendmail on RH. You bet it's gone. Now I am going to reimplement it it with maildrop/postfix on Gentoo. If (in case of more free time) I'll do it as a generic script (not specific to my needs, but customizable for them) then I'll submit the portage commit request in Bugzilla. otherwise I can forward my script to you privately.
Top
Oopsz
Guru
Guru
Posts: 340
Joined: Tue Oct 08, 2002 3:05 pm

Re: This may be a naff question, but..

  • Quote

Post by Oopsz » Wed May 14, 2003 6:24 pm

puke wrote::?: Can this use the pc-speaker?

I have a server that sits in the corner without a monitor, I would like it to talk when there are problems, but I don't want to have to load sound drivers etc.
try patching this oss driver into your kernel

:)
Top
beza1e1
n00b
n00b
User avatar
Posts: 42
Joined: Sat Apr 19, 2003 5:03 pm
Location: germany
Contact:
Contact beza1e1
Website

  • Quote

Post by beza1e1 » Thu May 15, 2003 10:05 am

I just want to say thanks for this tip :)

It is so nice, if your PC wishes you a good night ...
Top
nephros
Advocate
Advocate
User avatar
Posts: 2139
Joined: Fri Feb 07, 2003 2:46 am
Location: Graz, Austria (Europe - no kangaroos.)
Contact:
Contact nephros
Website

This is cool,

  • Quote

Post by nephros » Thu May 15, 2003 11:35 am

thanks, that thing is way cool.

God, this reminds me of old Amiga times!

Now, anyone know how to set up other languages.

I downloaded the German deX packages, and unzipped them to /usr/lib/mbrola/voices/german/de{1..5},
edited voices.scm to include "de1" on top of the list

Code: Select all

(defvar default-voice-priority-list
  '(de1
    en1_mbrola
    ...
and edited festivalrc to:
(set! voice_default 'voice_de1)

but that does not work...
Please put [SOLVED] in your topic if you are a moron.
Top
riggagoogoo
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 108
Joined: Sun Apr 06, 2003 4:44 pm

  • Quote

Post by riggagoogoo » Thu May 15, 2003 2:33 pm

panserg

Sounds quite cool, I would appreciate a copy of your script however if your almost done with an ebuild I will wait till its made available

Cheers

Rigg
Top
Vi Rocks
n00b
n00b
User avatar
Posts: 21
Joined: Mon May 05, 2003 8:51 pm

One question

  • Quote

Post by Vi Rocks » Thu May 15, 2003 6:05 pm

There was a startup script called "audio_message" provided earlier on in this thread, which plays a message during the booting and shutting down of gentoo.
But i have a question for it.
According to gentoo manuals the starting and stopping is in alphabetical order of scripts present in /etc/runlevels/default.

I use ALSA for soue. Since "audio_message" comes later in alphabetical order than "alsa", during boot "alsa" startup script runs first and then "audio_message". This is the correct way. But during shutdown alsa shuts down before audio_message so , Even when audio_message's stop fuction is called , there is no sound ?
Any work around for this. Or better still instead of booting, can this be done per user login/logout. ?
thanks
Oh, the searing kiss of hot lead. How I've missed you! I mean -- I think I'm dying.
Top
BeaTtheMeaT666
n00b
n00b
Posts: 54
Joined: Tue Nov 12, 2002 3:28 pm

Re: This is cool,

  • Quote

Post by BeaTtheMeaT666 » Fri May 16, 2003 9:32 pm

nephros wrote:thanks, that thing is way cool.
God, this reminds me of old Amiga times!
Me too ;) I remember calling people on the phone and let the computer talk to them ...

Speechd this is so f***ing fun,
i just edited /etc/syslog.conf and
changed /var/log/messages to /dev/speech .

enjoy,

bobo
Top
carrett
Apprentice
Apprentice
User avatar
Posts: 273
Joined: Sat Mar 22, 2003 8:44 am
Contact:
Contact carrett
Website

  • Quote

Post by carrett » Mon May 19, 2003 2:59 am

hey, this is awesome. when i do: echo "Hello world" > /dev/speech
the system just sits there, no sound comes out and i have to ctl-C to stop the command. however, echo "Hello world" | festival --tts -
works perfectly, anybody know how to make the device work?
I'm against picketing, but I don't know how to show it.
Top
riggagoogoo
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 108
Joined: Sun Apr 06, 2003 4:44 pm

  • Quote

Post by riggagoogoo » Mon May 19, 2003 8:24 am

I had this problem too at first however when i did a kill artsd and ran it again it worked fine (I assume your running arts?).

There is a good post on the board on how to make OSS work with Arts, check it out here:

Code: Select all

http://forums.gentoo.org/viewtopic.php?t=15110

Hope this helps

Rigga
Top
carrett
Apprentice
Apprentice
User avatar
Posts: 273
Joined: Sat Mar 22, 2003 8:44 am
Contact:
Contact carrett
Website

  • Quote

Post by carrett » Mon May 19, 2003 8:27 am

i'm not running artsd

thanks though!
I'm against picketing, but I don't know how to show it.
Top
barrowaj
n00b
n00b
User avatar
Posts: 33
Joined: Sat Mar 01, 2003 9:37 am
Location: Austin, TX

Same Problem Here

  • Quote

Post by barrowaj » Tue May 27, 2003 5:11 pm

I am having the same problem. The festival server gives:

Code: Select all

prophet root # festival --server
socket: bind failed
And so therefore speechd cannot connect to it. I saw people having this problem earlier in this thread but don't beleive anyone posted a solution. I guess it has something to do with a port not being available, and I know nothing of how ports are configured on linux.

Can someone who has gotten this to work please offer some advice?
Top
rhodyne
n00b
n00b
User avatar
Posts: 16
Joined: Fri Oct 25, 2002 4:47 am
Location: Granger TX
Contact:
Contact rhodyne
Website

  • Quote

Post by rhodyne » Fri May 30, 2003 6:55 am

This is fun. I got to messing around with it and I made a few adjustments to the scripts shown here.
1st my /etc/init.d/speechd init script looks like

Code: Select all

#!/sbin/runscript

start() {
	ebegin "Starting speechd"
	start-stop-daemon --start --quiet --pidfile /var/run/speechd.pid --exec /usr/bin/speechd
	eend $? "Failed to start speechd"

stop() {
	ebegin "Stopping speechd"
	start-stop-daemon --stop --quiet --pidfile /var/run/speechd.pid
	killall festival            # the above pid only references the parent
	eend $? "Failed to stop speechd"

restart() {
	svc_stop                    # gentoo rc-scripts
	sleep 1                     # recommended process 
	svc_start
}
Then I added vocal alerts to the local scripts
/etc/conf.d/local.start

Code: Select all

if [ -e "/dev/speech" ]
then
	say "Gentoo system $HOSTNAME is ready" && sleep 4 && saytime
else
	echo 'Error .. speechd not loaded'
fi
and /etc/conf.d/local.stop

Code: Select all

RUNLV=`runlevel | cut -d ' ' -f 2`
if [ -e "/dev/speech" ]
then
	if [ "$RUNLV" == "0" ]
	then
		say $HOSTNAME is shutting down" && sleep 3
	elif [ "$RUNLV" == "6" ]
	then
		say $HOSTNAME is rebooting now && sleep 3
	else
		echo "Found invalid runlevel"
	fi
else
	echo 'Error .. speechd not loaded'
fi
And I removed the text echo from the say script that bassvandijk put in this post earlier because I didn't want it.

Once I get this all setup this system goes headless.

I'm still working on getting a login/logout response that doesn't generate errors for remote logins.
./done
Top
rhodyne
n00b
n00b
User avatar
Posts: 16
Joined: Fri Oct 25, 2002 4:47 am
Location: Granger TX
Contact:
Contact rhodyne
Website

  • Quote

Post by rhodyne » Sat May 31, 2003 3:26 am

Well I can get a global login welcome message by adding some lines to /etc/profile

Code: Select all

if [ -e "/dev/speech" ]
then
        if [ `/usr/bin/whoami` = 'root' ]
        then
                say "Welcome to $HOSTNAME ROOT"
                say "Please minimize your time logged in this way"
                sleep 6
                saytime
        else
                say "Welcome to $HOSTNAME $(whoami)"
                say "Enjoy your stay"
        fi
else
        echo 'Error .. speechd not loaded'
fi
so now I get vocal "warning" that someone is logged in. All vocals happen at the server, of course.

If you have a lot of logins close together you will get errors on some of them; you might want to shorten the speech to something like "$(whoami) logged in". I also like using the /usr/bin/saytime script that festival installs by default to help identify root logins as different.
./done
Top
OneOfOne
Guru
Guru
User avatar
Posts: 368
Joined: Wed May 28, 2003 11:55 pm
Contact:
Contact OneOfOne
Website

  • Quote

Post by OneOfOne » Tue Jun 03, 2003 3:27 pm

it doesnt compile with gcc-3.3 :(...
peace
Top
LGW
n00b
n00b
Posts: 60
Joined: Wed Oct 02, 2002 11:30 pm

  • Quote

Post by LGW » Wed Jun 04, 2003 8:57 am

OK, it's great. I'm not yet sure what to use it for, but it's great :D
Top
nalin
Apprentice
Apprentice
Posts: 172
Joined: Fri Sep 27, 2002 6:18 pm
Location: Long Beach
Contact:
Contact nalin
Website

  • Quote

Post by nalin » Wed Jun 04, 2003 10:14 pm

listen to the clipboard (in konqueror):
select klipper->actions enabled
select klipper->configure klipper
under general tab enable "Replay Actions..."
under actions tab add an action
use a regexp like "^[ \n\r\t0-9a-zA-Z]*$"
right click select add command
use command "echo %s > /dev/speech"

To give the action and command better names:
nano -w ~/.kde/share/config/klipperrc
change <add action> and <add command> to something like "text" and "say it", klipper needs be restarted to take effect for the values
The "shopping" key is a whole different beast, "m" gets stuck and you hit it again - "shopping" gets stuck and you end up closing 129 instances of konqueror - thats why the hotkeys people are bastards
Top
wrs4
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 98
Joined: Tue May 27, 2003 7:55 pm
Location: Alexandria, VA

  • Quote

Post by wrs4 » Fri Jun 20, 2003 12:49 am

Hey guys, this is pretty cool. I decided to see if I could have a little more fun with it. I wrote the following script to parse out the date and run it; works fine. The next step is to see if I can't run it from cron for something like an alarm clock. Anyhow, here is the script. You'll need Perl's Date::Format module installed to use it:

Code: Select all

#!/usr/bin/perl
use strict;

use Date::Format;

################################################################################
#
################################################################################

# This script is designed to convert standard date text to something that
# festival can play in a human-recognizable manner.  I could have been fancy
# and used GetOpts to make it more configurable, but I think it does the job
# as-is.  If you have any bug reports, questions, comments, etc. email me at
# william@free.house.cx with "festival script" in the subject line so I know
# what you're talking about :)
#
#   William Sutton
#   william@free.house.cx
#
# This script is licensed as freeware, with no guarantee of fitness for any
# purpose beyond that expressed in the foregoing.

# to see the command we'll execute, run ./script_name 1
my $debug       = $ARGV[0] || 0;

# configure the appropriate binary paths if somewhere else
my $festival    = "/usr/bin/festival";
my $echo        = "/bin/echo";

# We want text in the format of "Day of week, Numeric day Month Year, Hours
# Minutes, Time Zone
my $date_text   = digit2txt (time2str ('%A, %e %B %Y, %H %M, %Z',time));
my $command     = "$echo \"(SayText \\\"$date_text\\\")\" | $festival";

# debug if requested
if ($debug == 1)
{
    print "\n\n";
    print "*** Playing => $command ***\n";
    print "\n\n";
}

# play the text string
qx { $command };

################################################################################
#
################################################################################

sub digit2txt
{
    my $text    = shift;

    # Ordinary human-recognizable speech values rather than, say,
    # "one nine" for "nineteen"
    my %numbers = (
        teens   => [ 'ten','eleven',
                     'twelve','thirteen',
                     'fourteen','fifteen',
                     'sixteen','seventeen',
                     'eighteen','nineteen'
                   ],
        tens    => [ 'twenty', 'thirty',
                      'forty', 'fifty',
                      'sixty', 'seventy',
                      'eighty', 'ninety'
                   ],
        digits  => [ 'one','two',
                     'three','four',
                     'five','six',
                     'seven','eight',
                     'nine'
                   ]
    );

    # if we have a four digit pattern (e.g., the year)
    if ($text =~ /(\d{4})/)
    {
        my ($thousands,$hundreds,$tens,$ones) = split (//, $1);

        # convert thousands to text
        my $new_text = $numbers{digits}[$thousands - 1] . " thousand ";

        # likewise, hundreds if non-zero
        if ($hundreds > 0)
        {
            $new_text .= $numbers{digits}[$hundreds - 1] . " hundred ";
        }

        # recurse and parse the tens portion; I love recursion!
        $new_text .= digit2txt ("$tens$ones");

        # substitute new text for old and exit block
        $text =~ s/$1/$new_text/;
    }
    # if we have a two digit pattern (e.g., hours, minutes)
    elsif ($text =~ /(\d{2})/)
    {
        my ($tens,$ones) = split (//, $1);

        my $new_text;

        # if we have 1-9, ...
        if ($tens == 0 && $ones > 0)
        {
            $new_text = $numbers{digits}[$ones - 1];
        }
        # or if we have 20-99, ...
        elsif ($tens > 1)
        {
            $new_text = $numbers{tens}[$tens - 2];

            if ($ones > 0)
            {
                $new_text .= " " . $numbers{digits}[$ones - 1];
            }
        }
        # or if we have 10-19, ...
        elsif ($tens == 1)
        {
            $new_text = $numbers{teens}[$ones - 1];
        }

        # substitute new text for old and exit block
        $text =~ s/$1/$new_text/;
    }

    # if we still have digits in the text, recurse and parse
    # otherwise, just return
    return ($text =~ /\d+/ ? digit2txt ($text) : $text);
}
Top
wrs4
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 98
Joined: Tue May 27, 2003 7:55 pm
Location: Alexandria, VA

  • Quote

Post by wrs4 » Fri Jun 20, 2003 1:30 am

Got it to cron, going to hunt up the volume docs someone mentioned earlier. Incidentally, while I was at it, I made a copy of the above script and tweaked it to handle general commands from the command line:

Code: Select all

#!/usr/bin/perl
use strict;

################################################################################
#
################################################################################

# I could have been fancy and used GetOpts to make it more configurable, but
# I think it does the job as-is.  If you have any bug reports, questions,
# comments, etc. email me at william@free.house.cx with "festival script" in
# the subject line so I know what you're talking about :)
#
#   William Sutton
#   william@free.house.cx
#
# This script is licensed as freeware, with no guarantee of fitness for any
# purpose beyond that expressed in the foregoing.

# to see the command we'll execute, run ./script_name text 1
my $exec	= $ARGV[0] || "No text specified";
my $debug       = $ARGV[1] || 0;

# configure the appropriate binary paths if somewhere else
my $festival    = "/usr/bin/festival";
my $echo        = "/bin/echo";

my $text = $exec;
$text =~ s/ .*//;

# We want text in the format of "Day of week, Numeric day Month Year, Hours
# Minutes, Time Zone
my $command     = "$echo \"(SayText \\\"$text\\\")\" | $festival";

# debug if requested
if ($debug == 1)
{
    print "\n\n";
    print "*** Playing => $command ***\n";
    print "\n\n";
}

# play the text string
qx { $command };
qx { $exec };
Then, since I have enlightenment running, I did the following to my .enlightenment/user_apps.menu file:

Code: Select all

"User Application List'"
"Eterm" NULL exec "/scripts/festival-command.pl 'Eterm --trans --shade 30 --tint 0x880088 --visual-bell --buttonbar=0 --title Eterm'"
"nedit" NULL exec "/scripts/festival-command.pl 'nedit'"
"The GIMP" NULL exec "/scripts/festival-command.pl 'gimp'"
"Gaim" NULL exec "/scripts/festival-command.pl 'gaim'"
"Imlib Settings" NULL exec "/scripts/festival-command.pl 'imlib_config'"
"X-Chat" NULL exec "/scripts/festival-command.pl 'xchat-2'"
"XMMS" NULL exec "/scripts/festival-command.pl 'xmms'"
"XCDRoast" NULL exec "/scripts/festival-command.pl 'xcdroast'"
"Gnome Volume Control" NULL exec "/scripts/festival-command.pl 'gnome-volume-control'"
"Gkrellm" NULL exec "/scripts/festival-command.pl 'gkrellm2'"
"Xscreensaver" NULL exec "/scripts/festival-command.pl 'xscreensaver'"
(I keep my personal scripts in /scripts, add salt or pepper to taste)
Top
wrs4
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 98
Joined: Tue May 27, 2003 7:55 pm
Location: Alexandria, VA

  • Quote

Post by wrs4 » Fri Jun 20, 2003 2:05 am

Did anyone figure out how to adjust the volume on this?
Top
rhodyne
n00b
n00b
User avatar
Posts: 16
Joined: Fri Oct 25, 2002 4:47 am
Location: Granger TX
Contact:
Contact rhodyne
Website

  • Quote

Post by rhodyne » Fri Jun 20, 2003 3:39 am

I use ermixer to control mix levels. It's a console app with next to no overhead. Save a few different profiles and you can script volume changes :o
./done
Top
wrs4
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 98
Joined: Tue May 27, 2003 7:55 pm
Location: Alexandria, VA

  • Quote

Post by wrs4 » Fri Jun 20, 2003 6:05 am

Hmm...I get about the same thing if I run gnome-volume-control but with mouse too.... :? If I want the speechd to always be louder than the music, etc, what do my settings need to be? Right now I have Vol at max and everything else at default.
Top
Gio
n00b
n00b
User avatar
Posts: 19
Joined: Mon Jul 01, 2002 12:49 pm
Location: Wheaton, IL USA

festival and speech-tools update in bugzilla

  • Quote

Post by Gio » Sat Jun 21, 2003 3:36 pm

In bugzilla #22053 I updated festival and speech-tools to compile on gcc-3.2.3. Also did some seperation and clean up - comments welcome.

** update ** compiles on gcc 3.3 too.
Last edited by Gio on Mon Jun 23, 2003 11:53 pm, edited 1 time in total.
Top
bassvandijk
Guru
Guru
User avatar
Posts: 306
Joined: Fri Sep 13, 2002 9:22 pm
Location: Haps, Netherlands

  • Quote

Post by bassvandijk » Mon Jun 23, 2003 5:32 pm

wrs4 wrote:Did anyone figure out how to adjust the volume on this?
See the FAQ at the festival website:
http://www.cstr.ed.ac.uk/cgi-bin/lists. ... olume.html
Top
Post Reply

136 posts
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy