Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!apple!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: Sound Manager Message-ID: <217@internal.Apple.COM> Date: 11 Nov 88 18:20:58 GMT References: <3ea47cbb.b097@shadow.engin.umich.edu> Organization: Advanced Technology Group, Apple Computer Lines: 27 In article <3ea47cbb.b097@shadow.engin.umich.edu> mystone@caen.engin.umich.edu (Dean Yu) writes: > >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. There was a message on AppleLink recently disussing this. Basically, you should only allocate a sound channel when you intend to play sounds, and dispose of it whe nthe sound finishes. Allocating a channel prevents other code from making sounds (eg, it prevents SysBeep from working). In addition, when you play a snd resource, it is likely that a synthesizer is added to the channel, since most resources specify this. This means that you should create the sound channel unlinked to any synthesizer. It also means that if you place the resource twice in the same channel, the synthesizer will be added twice. This probably accounts for the degradation in the sound (and possibly the crashes on SndDisposeChannel). -- Larry Rosenstein, Object Specialist Apple Computer, Inc. 20525 Mariani Ave, MS 46-B Cupertino, CA 95014 AppleLink:Rosenstein1 domain:lsr@Apple.COM UUCP:{sun,voder,nsc,decwrl}!apple!lsr