Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Win32::OLE get list of installed voices

by Discipulus (Canon)
on May 15, 2019 at 09:19 UTC ( [id://11100010]=note: print w/replies, xml ) Need Help??


in reply to Win32::OLE get list of installed voices

Hello Takamoto,

I found a sub in an experiment of mines dating 2007.. I rearranged for you:

use strict; use warnings; use Data::Dumper; use Win32::OLE; my %voices = SAPIgetVoices(); print Dumper \%voices; sub SAPIgetVoices{ my $tts = Win32::OLE->new("Sapi.SpVoice") or die "Sapi.SpVoice fai +led"; my %VOICES; for(my $VoiceCnt=0;$VoiceCnt < $tts->GetVoices->Count();$VoiceCnt+ ++) { my $desc = $tts->GetVoices->Item($VoiceCnt)->GetDescription; #print "descr= $desc\n"; $VOICES{"$desc"} = $VoiceCnt; } return %VOICES; } # OUTPUT $VAR1 = { 'Microsoft Elsa Desktop - Italian (Italy)' => 0, 'Microsoft Zira Desktop - English (United States)' => 1 };

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: Win32::OLE get list of installed voices
by Takamoto (Monk) on May 15, 2019 at 11:05 UTC

    Lovely, Discipulus. Simply perfect!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11100010]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-19 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found