#!perl -w use strict; use warnings; use Win32::OLE; # Set up speech. my $voice = Win32::OLE->new("Speech.VoiceText") or die("TTS failed"); $voice->Register("", "$0"); $voice->{Enabled} = 1; # optional my $question = <<__EOS__; mdog has asked for the wisdom of the Perl Monks concerning the following question: So I'd really like to be able to do Text to Speech on a Windows machine. __EOS__ my $answer = <<__EOS__; Hello, mdog! This example works for me on Win2k, perl 5.6.0. It is based on the javascript from article http://www.winmag.com/fixes/2000/0901.htm. Rudif __EOS__ $voice->Speak($question, 1); $voice->Speak($answer, 1); while ($voice->IsSpeaking()) { sleep 1; } __END__