Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!uwm.edu!ogicse!ucsd!ucbvax!hplabs!hp-pcd!hpvcfs1!stevem From: stevem@hpvcfs1.HP.COM (Steve Miller) Newsgroups: comp.sys.mac.programmer Subject: Need help with the new sound manager! Message-ID: <900004@hpvcfs1.HP.COM> Date: 10 Mar 90 20:39:32 GMT Organization: Hewlett Packard, Vancouver, WA Lines: 46 OK boys and girls, I'm about at my wits end on the subject of playing 'snd ' resources on the Mac. I'm trying to use snd's in a simple game where the sounds are played asynchronously while arcade style animation is occuring. I'm using Think Pascal 2.01 under system 6.02 (finder 6.1) and my code is structured like this: my_sound_hdl := GetResource('snd ',4); {This is a 1 second digitized sound} channel_ptr := SndChannelPtr(NewPtr(sizeof(SndChannel))); error := SndNewChannel(channel_ptr,5,0,nil); ... later, whenever a sound is played, it is done in the following manner ... command.cmd := flushCmd; {Flush any currently playing sound in channel_ptr} command.param1 := 0; command.param2 := 0; error := SndDoCommand(channel_ptr,command,FALSE); error := SndPlay(channel_ptr,my_sound_hdl,TRUE); What happens is that the sounds start out playing fine. After the first 3 to 6 instances of the sound, it will stop playing them. Occasionally they will start up again for 1 or 2 instances before permanently failing to play. Then the system will crash with an address error or with an "internal error 4023" inside SndDisposeChannel at the end of the game: error := SndDisposeChannel(channel_ptr,TRUE); If the sounds are played sychronously then everything is OK. I've tried many variations on the above scheme with exactly the same results (not flushing the commands, letting the system allocate the channel pointer, etc...) Since I already found one bug in volume 5 of Inside Mac pertaining to the new sound manager's use of Async. sound, I feel there might be something else I'm missing. HELP HELP HELP!! Does anyone have experience using Asynch sounds under the new sound manager? BTW, I've had no problems using async sounds under the old sound manager, but I need the new sound manager to use 'snd ' resources. Steven Miller ...hplabs!hpvcfs1!stevem Vancouver Division Hewlett Packard