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 Previous  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
panserg
Apprentice
Apprentice


Joined: 16 Apr 2003
Posts: 188

PostPosted: Fri May 09, 2003 2:27 pm    Post subject: Reply with quote

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 :)
Back to top
View user's profile Send private message
riggagoogoo
Tux's lil' helper
Tux's lil' helper


Joined: 06 Apr 2003
Posts: 108

PostPosted: Wed May 14, 2003 10:20 am    Post subject: Reply with quote

Quote:

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???
Back to top
View user's profile Send private message
panserg
Apprentice
Apprentice


Joined: 16 Apr 2003
Posts: 188

PostPosted: Wed May 14, 2003 3:14 pm    Post subject: Reply with quote

riggagoogoo wrote:
Quote:

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.
Back to top
View user's profile Send private message
Oopsz
Guru
Guru


Joined: 08 Oct 2002
Posts: 340

PostPosted: Wed May 14, 2003 6:24 pm    Post subject: Re: This may be a naff question, but.. Reply with quote

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

:)
Back to top
View user's profile Send private message
beza1e1
n00b
n00b


Joined: 19 Apr 2003
Posts: 42
Location: germany

PostPosted: Thu May 15, 2003 10:05 am    Post subject: Reply with quote

I just want to say thanks for this tip :)

It is so nice, if your PC wishes you a good night ...
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Thu May 15, 2003 11:35 am    Post subject: This is cool, Reply with quote

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:

(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.
Back to top
View user's profile Send private message
riggagoogoo
Tux's lil' helper
Tux's lil' helper


Joined: 06 Apr 2003
Posts: 108

PostPosted: Thu May 15, 2003 2:33 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Vi Rocks
n00b
n00b


Joined: 05 May 2003
Posts: 21

PostPosted: Thu May 15, 2003 6:05 pm    Post subject: One question Reply with quote

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.
Back to top
View user's profile Send private message
BeaTtheMeaT666
n00b
n00b


Joined: 12 Nov 2002
Posts: 54

PostPosted: Fri May 16, 2003 9:32 pm    Post subject: Re: This is cool, Reply with quote

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
Back to top
View user's profile Send private message
carrett
Apprentice
Apprentice


Joined: 22 Mar 2003
Posts: 273

PostPosted: Mon May 19, 2003 2:59 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
riggagoogoo
Tux's lil' helper
Tux's lil' helper


Joined: 06 Apr 2003
Posts: 108

PostPosted: Mon May 19, 2003 8:24 am    Post subject: Reply with quote

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:

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



Hope this helps

Rigga
Back to top
View user's profile Send private message
carrett
Apprentice
Apprentice


Joined: 22 Mar 2003
Posts: 273

PostPosted: Mon May 19, 2003 8:27 am    Post subject: Reply with quote

i'm not running artsd

thanks though!
_________________
I'm against picketing, but I don't know how to show it.
Back to top
View user's profile Send private message
barrowaj
n00b
n00b


Joined: 01 Mar 2003
Posts: 33
Location: Austin, TX

PostPosted: Tue May 27, 2003 5:11 pm    Post subject: Same Problem Here Reply with quote

I am having the same problem. The festival server gives:
Code:
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?
Back to top
View user's profile Send private message
rhodyne
n00b
n00b


Joined: 25 Oct 2002
Posts: 16
Location: Granger TX

PostPosted: Fri May 30, 2003 6:55 am    Post subject: Reply with quote

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:
#!/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:
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:
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
Back to top
View user's profile Send private message
rhodyne
n00b
n00b


Joined: 25 Oct 2002
Posts: 16
Location: Granger TX

PostPosted: Sat May 31, 2003 3:26 am    Post subject: Reply with quote

Well I can get a global login welcome message by adding some lines to /etc/profile
Code:
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
Back to top
View user's profile Send private message
OneOfOne
Guru
Guru


Joined: 28 May 2003
Posts: 368
Location: Alexandria, Egypt

PostPosted: Tue Jun 03, 2003 3:27 pm    Post subject: Reply with quote

it doesnt compile with gcc-3.3 :(...
peace
Back to top
View user's profile Send private message
LGW
n00b
n00b


Joined: 02 Oct 2002
Posts: 60

PostPosted: Wed Jun 04, 2003 8:57 am    Post subject: Reply with quote

OK, it's great. I'm not yet sure what to use it for, but it's great :D
Back to top
View user's profile Send private message
nalin
Apprentice
Apprentice


Joined: 27 Sep 2002
Posts: 172
Location: Long Beach

PostPosted: Wed Jun 04, 2003 10:14 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
wrs4
Tux's lil' helper
Tux's lil' helper


Joined: 27 May 2003
Posts: 98
Location: Alexandria, VA

PostPosted: Fri Jun 20, 2003 12:49 am    Post subject: Reply with quote

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:

#!/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);
}
Back to top
View user's profile Send private message
wrs4
Tux's lil' helper
Tux's lil' helper


Joined: 27 May 2003
Posts: 98
Location: Alexandria, VA

PostPosted: Fri Jun 20, 2003 1:30 am    Post subject: Reply with quote

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:

#!/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:

"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)
Back to top
View user's profile Send private message
wrs4
Tux's lil' helper
Tux's lil' helper


Joined: 27 May 2003
Posts: 98
Location: Alexandria, VA

PostPosted: Fri Jun 20, 2003 2:05 am    Post subject: Reply with quote

Did anyone figure out how to adjust the volume on this?
Back to top
View user's profile Send private message
rhodyne
n00b
n00b


Joined: 25 Oct 2002
Posts: 16
Location: Granger TX

PostPosted: Fri Jun 20, 2003 3:39 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
wrs4
Tux's lil' helper
Tux's lil' helper


Joined: 27 May 2003
Posts: 98
Location: Alexandria, VA

PostPosted: Fri Jun 20, 2003 6:05 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Gio
n00b
n00b


Joined: 01 Jul 2002
Posts: 19
Location: Wheaton, IL USA

PostPosted: Sat Jun 21, 2003 3:36 pm    Post subject: festival and speech-tools update in bugzilla Reply with quote

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
Back to top
View user's profile Send private message
bassvandijk
Guru
Guru


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

PostPosted: Mon Jun 23, 2003 5:32 pm    Post subject: Reply with quote

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.cgi?config=festival_faq&entry=arunning_festival/volume.html
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 Previous  1, 2, 3, 4, 5, 6  Next
Page 3 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