[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SpeechIO-123] modified ircspeak.pl to use /dev/speech

I was talking to Thunder in IRC about various things, and helping him beat
speechd/speech.irc into submission.  When he got it to work, he commented
that it didn't get bogged down like ircspeak.pl for sirc/ksirc does.  I
thought back over ircspeak, and remembered that it was reloading festival
every time it spoke a line.  

I eventually decided to try making ircspeak use /dev/speech.  Well, it
works.  And I only had to modify 2 lines of code.  Here's the diff:

diff ircspeak.pl-0.2 ircspeak.pl-0.3
<               open(SPEECH,"|$festival 2>&1 >/dev/null") || do { &print("*E* Error opening pipe to $festival"); return; };
>               open(SPEECH,">>/dev/speech") || do { &print("*E* Error opening /dev/speech"); return; };
<       print SPEECH "(SayText \"$speakline\")\n";
>       print SPEECH "$speakline\n";

This version can be downloaded from http://www.op.net/~darxus/speechio/dl
and around 3pm (estern time) it should be propagated to

Gareth: You sounded somewhat interested in looking into doing this.  I
think it works rather well.  If you decided to use these changes, you may
want to do...

if ( -p "/dev/speech )
  use /dev/speech
} else {
  use the pipe to festival

the -p "/dev/speech" checks if there's a named pipe by that filename.
That should mean speechd is installed, but not necessarily running.

Hmm... supposed I should remove /var/run/speechd.pid when exiting so you
could check for that....

PGP fingerprint = 03 5B 9B A0 16 33 91 2F  A5 77 BC EE 43 71 98 D4
            darxus@op.net / http://www.op.net/~darxus
                         Far Beyond Reason