in reply to Text to Speech Win32::OLE Error

The invalid class string is "Speech.VoiceText". This is the M$ application not Perl. For example to fool around with Excel you do:

my $Excel = Win32::OLE->new("Excel.Application" , sub { $_[0]->Quit } +)

So you don't appear to have the TTS engine installed. It works for me on Win2k but if I change the string to Speech1.VoiceText" (which of course does not exists) I get the invalid class string error. You can (probably) find the engine here

cheers

tachyon

Replies are listed 'Best First'.
Re^2: Text to Speech Win32::OLE Error
by TROGDOR (Scribe) on Nov 02, 2004 at 00:11 UTC
    Hi Tachyon,

    Thanks for the suggestion. However, I know that TTS is already installed on my system. I'm pretty sure it ships standard with XP. In the control pannel, I can select "Speech", and preview the installed "LH Michael", "LH Michelle", and "Microsoft SAM" voices. Also, in Acrobat I can select View->Read Out Loud, and the page is spoken. So the TTS is there, I'm just not calling it right. Any idea how I can figure out the magic string?

    Speak friend and enter?

    Thanks, TROGDOR
      You're using Windows XP, which has SAPI5 installed by default. However, the class you're trying to load is SAPI4. Even if you'd install the SAPI4 runtime, you still won't be able to use the voices you mentioned, since SAPI5 voices can't be used in SAPI4.
      I recommend you use Win32::SAPI5. It does the hard work for you.

      Kind regards,


      Jouke Visser
      Using Perl to enable the disabled: pVoice