use Win32::OLE qw( EVENTS ); use Tk; my $DirectSS = new Win32::OLE( "{EEE78591-FE22-11D0-8BEF-0060081841DE}" ) or die "$!"; $mw = MainWindow->new(-title => "the BATKINS speaker"); my $text = $mw->Text->pack; $text->focus; $mw->Button(-text => 'say it', -command => sub { say($text->get("0.0", "end")); })->pack; MainLoop; sub say { my $say = shift; $DirectSS->Speak($say); while( $DirectSS->{Speaking} ) { Win32::OLE->SpinMessageLoop(); Win32::Sleep( 100 ); } }