Making my computer speak

brian_d_foy on 2002-11-14T08:35:48

Sometimes computers figure out your weaknesses and then use them to distract you from real work. Once you think that you beat them you waste time telling people about them. Its a virus.

This virus speaks output from Perl programs. If I wanted to get really fancy I could create a Tie module to multiplex output to where it should go and speak it as well. Um, let's see if I can forget I thought that.

#!/usr/bin/perl

use Mac::AppleScript qw(RunAppleScript);

foreach ( reverse ( 'blast off!', 1 .. 10 ) ) { print "$_\n";

RunAppleScript( qq| say "$_" | ); sleep 1; }