Making brian d foy's computer speak

| | Comments (0)
brian d foy wrote a program to make his computer talk. Here's a more efficient version using Mac::Speech (from Mac::Carbon), instead of RunAppleScript/DoAppleScript.

#!/usr/bin/perl
use Mac::Speech;
 
my $voice   = $Mac::Speech::Voice{Victoria};
my $channel = NewSpeechChannel($voice);
for ( reverse ('blast off!', 1 .. 10 ) ) {
    SpeakText($channel, $_);
    print "$_\n";
    sleep 1;
}
sleep 1 while SpeechBusy();
DisposeSpeechChannel($channel);

Now Playing: Blue Sunday - Tom Petty & The Heartbreakers (The Last DJ)

use.perl.org

Leave a comment

<pudge/*> (pronounced "PudgeGlob") is thousands of posts over many years by Pudge.

"It is the common fate of the indolent to see their rights become a prey to the active. The condition upon which God hath given liberty to man is eternal vigilance; which condition if he break, servitude is at once the consequence of his crime and the punishment of his guilt."

About this Entry

This page contains a single entry by pudge published on November 14, 2002 4:53 AM.

EyeTV was the previous entry in this site.

Interarchy, Mac::Glue, SFTP is the next entry in this site.

Find recent content on the main index or look in the archives to find all content.