re stereo sound problem on mac games in article ingemar isy ingemar ragnemalm ingemar isy liu se writes enter game developers the sound driver and current sound manager are inconveniently lame for making games the sound driver is pretty ok since it s fast sound manager used by the book is useless disposing of sound channels as soon as sound has completed is out of the question for games with smooth animation it s too slow why would you dispose a channel if you are going to play more sounds soon if you are trying to write a game you shouldn t be using sndplay instead make a channel and use buffercmds to play sounds on it it works great you can add callbacks to the channel also to let you know when the channel is getting empty before it gets empty the sound driver is so much snappier than sound manager unfortunately system supports it poorly making programs crash occasionally the moral of the story is to developers don t cheat well i want my code to work on old systems too i don t know about sys but at least on there are bugs in the sound manager that causes channels to hang with no error message this happends when i keep a channel open for long periods necessary for performance and play many sounds stopping sounds halfway callbacks seems not to be reliable then only way i can safely tell if a sound has stopped playing is to inspect private variables in the channel qhead i think it was and the only way i have found to tell if a channel is hung is to inspect an undocumented flag and modify it callbacks are very reliable i found them reliable even under system i was doing continuous background sound with interrupting sound effects on system with the im v documentation you probably were cancelling your callback commands out of your channels of course you didn t get called in general if you have problems with sounds working when you play one per channel and then close the channel with the related slowdown but then when you play more than one you don t work then you are adding more than one synthesizer to a channel possibly the same one multiple times this might be because you are calling sndplay on a preexisting channel with a sound resource which adds the sampled sound synthesizer to the channel first thing before it plays most sampled sounds have this command at the start of them you need to resedit the sound and remove that command then when you create your channel specify the sampled sound synthesizer to be the channel s synth then you can use asynch sndplay s all you want you ll probably want to switch to buffercmd s since you are going to have to use snddocommand anyway to add callbacks now before you go ahead and tell me i am full of it and the sound manager doesn t work for games remember spectre uses it and it works great if spectre can spare the cpu time you can too one little disclaimer there are some out there who say the sound manager in the iisi can t be made to work right i m not sure either way but i know for sure that you can make your sounds work correctly on every other machine using the sound manager steve
