sub talk { local $txt = $_[0]; use Win32::OLE; local $voice = Win32::OLE->new("Speech.VoiceText") or die("TTS failed"); $voice->Register("", "$0"); $voice->{Enabled} = 1; # optional $voice->Speak($txt, 1); while ($voice->IsSpeaking()) { sleep 1; } }