Making brian d foy's computer speak

pudge on 2002-11-14T12:53:28

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)