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__; Shall we play a game? __EOS__ my $answer = <<__EOS__; How about Global Thermonuclear Text to Speech. __EOS__ $voice->Speak($question, 1); $voice->Speak($answer, 1); while ($voice->IsSpeaking()) { sleep 1; }