in reply to Text to Speech
#!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 fol +lowing question: So I'd really like to be able to do Text to Speech on a Windows ma +chine. __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__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Text to Speech
by mdog (Pilgrim) on Jan 11, 2001 at 04:32 UTC |