[Pythonmac-SIG] Help me waste some time?
Richard Gordon
richard@richardgordon.net
Sun, 29 Jul 2001 19:44:53 -0400
In the course of cleaning out some forgotten folders, I came across a
script that some guy posted to the MacPerl list a few years ago that
was wonderfully irritating because it made the Mac yodel. To avoid
doing what I was supposed to be doing, I started exploring the
possibilities of converting this into macpython, but got stuck pretty
quickly trying to find something that equates to the perl Speech
module. I found some sound and soundmanager stuff, but couldn't find
anything about speech as such and am fuzzy about where to begin. If
someone could point me in the right direction, I'd appreciate it.
The original script written in the High Martian that is perl is
below. If you happen to have a copy of MacPerl around, it should play
ok.
#!perl
# "MacPerl Yodels" v1.0
# by David Seay <g-s@navix.net>
#
use Mac::Speech;
$channel[0] = NewSpeechChannel($Voice{'Cellos'}) or die $^E;
$pitch1 = 68;
$pitch2 = $pitch1 + 7;
$pause = .05;
for $note (0..7) {
SetSpeechPitch $channel[0], $pitch1;
SpeakText $channel[0], "a";
select(undef, undef, undef, $pause);
SetSpeechPitch $channel[0], $pitch2;
SpeakText $channel[0], "e";
select(undef, undef, undef, $pause);
}
SetSpeechPitch $channel[0], $pitch1 + 4;
SpeakText $channel[0], "who";
while (SpeechBusy()) {}
DisposeSpeechChannel $channel[0] if $channel[0];
Richard Gordon
--------------------
Gordon Design
Web Design/Database Development
http://www.richardgordon.net