Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!caen.engin.umich.edu!mystone From: mystone@caen.engin.umich.edu (Dean Yu) Newsgroups: comp.sys.mac.programmer Subject: Sound Manager Message-ID: <3ea47cbb.b097@shadow.engin.umich.edu> Date: 23 Sep 88 17:06:00 GMT Organization: U of M Engineering, Ann Arbor, Mich. Lines: 58 I'm writing a game for the Mac, and I'm using the Sound Manager routines in it to produce some sound effects. Unfortunately, I've got a bug that may or may not be a bug in the new System. Basically, it's a maze game, and whenever a player runs into a wall, it'll play a digitized "Ow!" sound. This works fine the first time, but it you try to run into the wall several times in succession really quickly, the sound will cut off a fraction of a second into the second time the sound plays, then there's no sound whatsoever after that point. Then, when I try to quit out of the game, it hangs on SndDisposeChannel. At first, I thought it might be a bug in my program, but when I try it on a Mac II, the sound works correcctly. (I've got other problems with the Mac II, but that's another story...) So I'm totally at a loss. Any ideas? I've got a Mac 512K Enhanced with 2 Megs RAM, SCSI port, Jasmine DirectDrive 40, System 6.0.2, and I'm writing this in MPW Pascal 2.0. Here are the questionable routines: procedure InitSounds; var err : OSErr; begin sChannel:=nil; { sChannel is a SndChannelPtr } err:=SndNewChannel(sChannel,5,initSRate22k+initMono,nil); OwSnd:=GetNamedResource('snd ','Ow!'); HLock(OwSnd); ExitSnd:=GetNamedResource('snd ','Hallelujah'); HLock(ExitSnd); end; procedure PlaySound(sound : Handle); var Err : OSErr; begin Err:=SndPlay(sChannel,sound,TRUE); { Play async sound } end; procedure ExitRoutine; var Err : OSErr; begin Err:=SndDisposeChannel(sChannel,false); { Hangs here on my Mac } DisposeWindow(gPtr); DisposeWindow(pw[1]); DisposeWindow(pw[2]); ClosePort(ScPtr); DisposPtr(pointer(ScPtr)); SetEventMask(everyEvent-keyUpMask); end; -------------------- Dean Yu, mystone@caen.engin.umich.edu I don't have an opinion... --------------------