[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Re: Voice Lister (was: Chorus)



Well, Cupertino is fairly close to San Bruno, and before doing MacPerl,
he _was_ an awker; in any case, "Nearawker" sounds better ...

-r



#!perl

# "Voice Lister" v1.0
# by David Seay <g-s@navix.net>
# additions by Vicki Brown <vlb@cfcl.com>,
# shamelessly stolen from other samples
# shameless additions by Rich Morin <rdm@cfcl.com>

use Mac::Speech;

# Multimatthias display of alphabetized list of Mac's voices.

$count      = CountVoices();

$voice      = GetIndVoice($count - 4 + 1);
$desc       = ${GetVoiceDescription($voice)};
$nameLength = ord(substr($desc,16,1));
$nameB      = substr($desc,17,$nameLength);
$channelB   = NewSpeechChannel($voice) or die $^E;

for $i (1..$count) {
  	$voice      = GetIndVoice($count - $i + 1);
  	$desc       = ${GetVoiceDescription($voice)};
  	$nameLength = ord(substr($desc,16,1));
  	$name       = substr($desc,17,$nameLength);
  	printf("%2d %s\n", $i, $name);
         $channel    = NewSpeechChannel($voice) or die $^E;

  	SpeakText $channelB, "$i, $name";
  	while (SpeechBusy()) {}

  	SpeakText($channel, "Matthias Neerawker");
  	while (SpeechBusy()) {}
  	DisposeSpeechChannel $channel if $channel;
}
--
Rich Morin:          rdm@cfcl.com, +1 650-873-7841, http://www.ptf.com/~rdm
Prime Time Freeware: info@ptf.com, +1 408-433-9662, http://www.ptf.com
MacPerl: http://www.macperl.com,       http://www.ptf.com/ptf/products/MPPE
MkLinux: http://www.mklinux.apple.com, http://www.ptf.com/ptf/products/MKLP

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org