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 outBradB wrote:could you hook it up so that kernel logs got spoken out?
Probably annoying, but maybe fun

Do you know procmail or maildrop or any mail-filtering program?riggagoogoo wrote:How did you do this???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
try patching this oss driver into your kernelpuke 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.

Code: Select all
(defvar default-voice-priority-list
'(de1
en1_mbrola
...


Me toonephros wrote:thanks, that thing is way cool.
God, this reminds me of old Amiga times!

Code: Select all
http://forums.gentoo.org/viewtopic.php?t=15110
Code: Select all
prophet root # festival --server
socket: bind failed
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
}Code: Select all
if [ -e "/dev/speech" ]
then
say "Gentoo system $HOSTNAME is ready" && sleep 4 && saytime
else
echo 'Error .. speechd not loaded'
fiCode: 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'
fiCode: 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'
fiCode: 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);
}
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 };
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'"

See the FAQ at the festival website:wrs4 wrote:Did anyone figure out how to adjust the volume on this?