does anyone have sample code using Mac::Speech ?

There are plenty of examples in the distribution -- looking at the tests is helpful.


Below is an example which lets you hear all the voices.

Neil


use Mac::Speech;

print "number of voices = ", CountVoices(), "\n";

my ($voice, $voice_channel);

for (my $i = 1; $i <= CountVoices(); $i++)
{
    print "voice $i\n";
    $voice = GetIndVoice($i);
    $voice_channel = NewSpeechChannel($voice)
            || die "failed to get voice channel\n";

    SpeakText($voice_channel, "this is voice $i");
    sleep(1) while SpeechBusy();
}



Reply via email to