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

Re: Fwd: Re: [MacPerl] MacPerl Harmonizes



>>At 21:06 -0500 14/08/1999, Greenblatt & Seay wrote:
>>>#!perl
>>>
>>># "Harmonizer" v1.0
>>># by David Seay <g-s@navix.net>
>>>#
>>>
>>>use Mac::Speech;
>># voice is not of type VoiceSpec.
>>File 'Untitled'; Line 23
>>
>so I picked up bigappl and it now works - didn't under cfm68k version.
>Neat
>
>-
>The world is one country and mankind, its citizens.
>
>Larry Moore

Hi Larry,

Sorry for the hassle, I'm glad you got it working. I don't have the cfm68k
version installed so I don't know how to check that out.

At some point not long ago, there was a change in the way a particular
voice selection was handled (see below). I don't know if it's related to
the problem you encountered but if you hadn't found a solution that's where
I would start looking, thinking that the old way might work for cfm68k.

On Mon, 23 Nov 1998, in response to my "MacPerl sings 'Camptown Races'"
submission, Chris Nandor replied with the following email to the list:


Note that in MacPerl 5.2.0r4, this:

$count = CountVoices();
for ($i = 0; $i++ < $count; ) {
 	$voice = GetIndVoice($i);
 	$desc  = ${GetVoiceDescription($voice)};
 	# some voices won't change pitch
 	# try 'Zarvox' or 'Pipe Organ' or 'Cellos' or 'Bad News'
	if ($desc =~ /Zarvox/) {
		$channel = NewSpeechChannel($voice)         or die $^E;

		for ($n = 0; $n < $songNotes; $n++) {
			($word,$note,$sharp,$dur) = split(" ",$song[$n]);

			SetSpeechPitch $channel, $pitch{$note}+$acc{$sharp};
			SpeakText $channel, $word               or die $^E;
			$d = int($tempo * $dur{$dur});
			for ($w = 0; $w < $d; $w++) { }
		}
		DisposeSpeechChannel $channel;
	}
}



can be changed to this:

# some voices won't change pitch
# try 'Zarvox' or 'Pipe Organ' or 'Cellos' or 'Bad News'
$voice = $Voice{Zarvox};
$channel = NewSpeechChannel($voice)         or die $^E;

for ($n = 0; $n < $songNotes; $n++) {
	($word,$note,$sharp,$dur) = split(" ",$song[$n]);

	SetSpeechPitch $channel, $pitch{$note}+$acc{$sharp};
	SpeakText $channel, $word               or die $^E;
	$d = int($tempo * $dur{$dur});
	for ($w = 0; $w < $d; $w++) { }
}
DisposeSpeechChannel $channel;


That is, %Voice is a tied hash that does the searching for a voice for you
(and caches the result, so it saves time if you use multiple voices in one
program).

--
Chris Nandor



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