Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/5/84; site cbdkc1.UUCP
Path: utzoo!watmath!clyde!cbosgd!cbdkc1!gwe
From: gwe@cbdkc1.UUCP ( George Erhart x4021 CB 3D288 WDS )
Newsgroups: net.micro.mac
Subject: Possible bug in megamax C (2.1b) syslib
Message-ID: <1196@cbdkc1.UUCP>
Date: Sat, 2-Nov-85 22:53:37 EST
Article-I.D.: cbdkc1.1196
Posted: Sat Nov  2 22:53:37 1985
Date-Received: Sun, 3-Nov-85 09:21:04 EST
Reply-To: gwe@cbdkc1.UUCP ( George Erhart x4021 CB 3D288 WDS )
Organization: AT&T Bell Laboratories, Columbus
Lines: 42

[ here little buggie ...  ]

I was playing with the macintalk speech stuff this weekend and discovered
a bug in the megamax C implementations of SetSoundVol() and GetSoundVol().
(This was using version 2.1b!) I don't have the sources for syslib, however
I attempted to crank the volume before starting the speech. A call to 
SetSoundVol(7) resulted in no change. So i disassembled the library file
sound.o and took a look. What I found did not make a lot of sense compared
to what IM said. So, I wrote two replacement routines SetSoundLevel() and
GetSoundLevel(), and they work. So here they are:


#include 

int
getsoundlevel()
{
	syspptr stuff;
	int retval;
	
	stuff = getsyspptr();
	retval = stuff->volclik & 0x0700;
	return(retval>>8 );
}

setsoundlevel(level)
int level;
{
	syspptr stuff;
	int current,ret;
	
	stuff = getsyspptr();
	current = stuff->volclik;
	current = current & 0xf8ff;
	level =  ((level&7)<<8);
	stuff->volclik = current | level;
	ret = writeparam();
}

-- 
George Erhart at AT&T Bell Laboratories Columbus, Ohio 
614-860-4021 {ihnp4,cbosgd}!cbdkc1!gwe