Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!ndcheg!ndmath!milo From: milo@ndmath.UUCP (Greg Corson) Newsgroups: comp.sys.mac.programmer Subject: Overlapping SOUNDS (playing 2 or more at once) Message-ID: <1499@ndmath.UUCP> Date: 1 Aug 89 17:19:40 GMT Organization: Math. Dept., Univ. of Notre Dame Lines: 35 I have a game I'm working on which needs the ability to play overlapping sounds from sound resources. My problem is I can't seem to figure out a clean way to do this that doesn't eat a lot of time. What I need is the ability to play two or more "snd " resources, overlapped. For example, playing background music, with occasional sound effects dropped on top of it. I suppose, what I need to do is read in the snd resources, extract the samples and then add them together and feed them on-the-fly to the sound manager. It seems, however, that I would need to break up the sounds into small pieces though...so I wouldn't have to wait for the current sound to finish before inserting a new one. I want to be able to have the background sounds playing, and be able to almost immediately drop in a "gun" or "warning" sound at any time, without interrupting the music. If anybody has any great ideas (or sample code) on how to do this, please write. My biggest problem is that right now I don't have a lot of CPU time to spair and, although I haven't tested it, I suspect if I start making 4 or more calls a second to Sound_Do_Command I'm going to eat the machine. Oh...also, Is it REALLY necessary to lock down a "snd " resource while it's playing in the background? The sound manager documentation doesn't mention anything about this...but I think someone else here did at one time. Greg Corson 19141 Summers Drive South Bend, IN 46637 (219) 277-5306 {pur-ee,rutgers,uunet}!iuvax!ndmath!milo