Sisyphus, Jan, all,
Right. I'm sitting here copying code between an un-networked Win98
laptop,
an XP machine and my Apple iBook and apologize for the sloppy copying.
This code does work on Win98 (with the Speech SDK installed)
and Win2000 (stock) but not on XP:
use Win::OLE;
my $voice = Win32::OLE->new('Speech.VoiceText');
die "no voice: $!\n" unless $voice;
$voice->Register('', 'Perl');
while (<STDIN>) {
$voice->Speak($_, 0);
}
On XP it dies with "no voice:" and nothing in $!.
On XP I can go into the "Control Panel" and choose
"Speech" and in the "Text to Speech" tab I can set the voice
and preview it successfully. But apparently there
is no "Speech.VoiceText" object created for Win32::OLE
to connect to.
XP Help says something about installing 3rd party
Text-to-Speech products.
Do I need to install the MS Speech SDK on XP?
It is downloadable at:
http://www.microsoft.com/speech/download/sdk51/
(this is a large download -68 megs- including speech
recognition which i do not need).
Was it on Win2000 automatically?
What kind of text-to-speech engine is by default present on XP?
Jan - the article you wrote in 1999 was instrumental in my
getting the code to work on Win98. It was for a Perl/Tk
program to help a handicapped friend of mine communicate.
Here's an article written about it:
http://www.perl.com/pub/a/2001/08/27/bjornstad.html
Now I have found another person to use this software and
they are running XP...
Thanks so much for any clues!
Jon
On Jun 13, 2005, at 7:19 PM, Jan Dubois wrote:
On Mon, 13 Jun 2005, Sisyphus wrote:
----- Original Message -----
On Tue, 14 Jun 2005, "Jon Bjornstad" <[EMAIL PROTECTED]> wrote:
This code:
use Win32::Ole;
my $voice = Win32::Ole->new("Speech.VoiceText");
$voice->Register('', 'Perl');
$voice->speak("hello world");
<STDIN>; # wait til it finishes speaking
has been used succesfully on Windows98 (with the
Microsoft Speech SDK installed) and on Windows 2000
(which has it installed by default, apparently).
Doesn't work for me on Windows 2000. Even after I correct the
typos (both
instances of "Ole" need to be replaced with "OLE") and 'use
warnings;' all I
get is:
Win32::OLE(0.1502) error 0x8002000e: "Invalid number of parameters"
in METHOD/PROPERTYGET "speak" at speak.pl line 5
Does 'use warnings;' result in the same warning on XP ?
I think Speak() takes 2 arguments. At least it did when I played
with it
for my OSCON talk in 1999:
http://opensource.activestate.com/authors/jandubois/Perl/TPC3/
fun.html#Can_I_access_COM_OLE_objects_f
So try something like
$voice->speak("hello world", 0);
in the script above.
Cheers,
-Jan
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs