On Mon, 13 Jun 2005, Jon Bjornstad wrote:
> 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 $!.

It looks like Speech.VoiceText is a SAPI 4.0 only object and
not installed on Windows XP.  You can download and install it,
but it may be easier to use the SAPI 5.1 engine already built
into XP.  Here is a trivial sample that works on my Tablet PC:

  use strict;
  use Win32::OLE;
  my $voice = Win32::OLE->new('SAPI.SpVoice');
  $voice->Speak("Hi there");

I just did a little bit of registry spelunking and browsing of
the documentation at:

  http://www.microsoft.com/speech/download/sdk51/

The documentation doesn't really cove later binding at all,
and the number of objects and methods seems overly complex,
but this _could_ be a fun project to make it do something
more complex.  Please send me some sample code if you do
work with things like events etc. :)

Cheers,
-Jan

PS: The Table PC edition of XP is slightly different than plain
XP, so it is possible that SAPI 5.1 isn't preinstalled, but I
don't have another system right now to test.


_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to