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

[MacPerl] CFM-68 and 68K plain perl



I received this code fragment from one of the members here:
If I  run this under the plain 68K perl, it runs (with the one glitch,) if
I run it using the CFM-68K then I get the following error:
# voice is not of type VoiceSpec.
File 'MacHD:Desktop Folder:MacPerl:Speak it'; Line 60
I'm puzzled by this and wonder if anyone has a suggestion/analysis/solution.
############## code fragment ###########
#!perl

use Mac::Speech;

$script = "
Lucy: Hey Ricky, how many drummers does it take to change a light bulb?
Ricky: I don't know Lucy. How many drummers does it take to change a light
bulb?
Lucy: None. They have a machine that does that now.
Innocent Bystander: Ha ha ha ha he he he he ho ho ho ho ho ho.
";

$cast{"Lucy"} = Kathy;
$cast{"Ricky"} = Fred;
$cast{"Innocent Bystander"} = Deranged;

@lines = split(/\n/, $script);

for ($i = 1; $i < @lines; $i++) {
	($character,$speech) = split(/:/, $lines[$i]);
	$speaker = $cast{$character};
	if (! $speaker) { $speaker = "Zarvox" }
	if (! $speech) { $speech = "I do not know what to say." }

	$voice = $Voice{$speaker};
	$channel = NewSpeechChannel($voice) or die $^E;
	SpeakText($channel, $speech) || die $^E;
	while (SpeechBusy()) {}
	DisposeSpeechChannel($channel);
}


-
The world is one country and mankind, its citizens.

Larry Moore and Shirley Allan
Union Street West
Fergus ON Canada



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch