Not sure how you get a list of voices programmatically but here is an old script I dug up.
#/usr/bin/perl -w
use strict;
use Win32::OLE;
my ($voice);
&Init_Voice();
&Talk("STARTING");
print "\nType something!\n";
while (my $aa = <STDIN>){
print "\nType something!\n";
chomp $aa;
&Talk($aa);
}
sub Init_Voice{
$voice = Win32::OLE->new("Speech.VoiceText") or die("TTS failed");
$voice->Register("", "$0");
$voice->{Enabled} = 1; # optional
$voice->{Speed}=150;
return $voice;
}
sub Talk{
my $info = shift;
return unless $info;
$voice->Speak($info, 1);
while ($voice->IsSpeaking()) {
sleep 1;
}
return;
}
END{
sleep(3);
}
Update
You might want to check out
Talking Winamp RF remote control, or Voice_Text.pm that comes with
Mister House and the documentation for the newest version of MS TTS. which can be obtained
here
-Lee
"To be civilized is to deny one's nature."
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.