TROGDOR has asked for the wisdom of the Perl Monks concerning the following question:
Greetings esteemed Monks,
I'm trying to get Text to Speech working in perl on a Win32 box, but I'm running into an "Invalid class string" error. First, here are my vitals:
OS: MS Professional XP, service pack 1.
Perl: ActivePerl v5.8.4, Binary build 810
Win32-OLE: version 0.1403, installed with ppm
I'm working with the verified code from this thread. Here's the code:
When I run this code, I get the following error message:
Thanks for your help,
TROGDOR
I'm trying to get Text to Speech working in perl on a Win32 box, but I'm running into an "Invalid class string" error. First, here are my vitals:
OS: MS Professional XP, service pack 1.
Perl: ActivePerl v5.8.4, Binary build 810
Win32-OLE: version 0.1403, installed with ppm
I'm working with the verified code from this thread. Here's the code:
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; }
When I run this code, I get the following error message:
Line 7 is the Win32::OLE->new call. This looks like a module dependency error. If I'm reading this error correctly, the OLE module is trying to instantiate a string, and the class is not defined. So I reran ppm, did a search for string, and found 111 results. I installed Set-String, but I still get this error. Is this a module dependency error, and if so, what module do I need to install to prevent this error? Is ppm smart enough to grab missing dependent modules at install time?C:\Apps\Perl\dev>perl speech.pl Win32::OLE(0.1403) error 0x800401f3: "Invalid class string" at speech. +pl line 7 eval {...} called at speech.pl line 7 TTS failed at speech.pl line 7.
Thanks for your help,
TROGDOR
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Text to Speech Win32::OLE Solution
by elwarren (Priest) on Nov 02, 2004 at 00:07 UTC | |
by TROGDOR (Scribe) on Nov 02, 2004 at 00:43 UTC | |
by jimrobertsiii (Scribe) on Nov 02, 2004 at 05:34 UTC | |
by Jouke (Curate) on Nov 02, 2004 at 10:54 UTC | |
Re: Text to Speech Win32::OLE Error
by tachyon (Chancellor) on Nov 01, 2004 at 23:48 UTC | |
by TROGDOR (Scribe) on Nov 02, 2004 at 00:11 UTC | |
by Jouke (Curate) on Nov 02, 2004 at 10:52 UTC | |
Re: Text to Speech Win32::OLE Error
by Jouke (Curate) on Nov 02, 2004 at 05:48 UTC |
Back to
Seekers of Perl Wisdom