Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!snorkelwacker!bu.edu!purdue!mentor.cc.purdue.edu!noose.ecn.purdue.edu!samsung!cs.utexas.edu!rutgers!ub.d.umn.edu!cs.umn.edu!moundst!eisvxe!cr_kempke From: cr_kempke@eisvxe.moundst.mn.org (Travelling SMU GURU) Newsgroups: comp.sys.mac.programmer Subject: Re: Asynchronous sound help? Message-ID: <2366@eisvxe.moundst.mn.org> Date: 16 Aug 90 10:31:46 GMT References: <1990Aug14.061951.25766@agate.berkeley.edu> Organization: 3M Engineering Information Systems Lines: 51 In article <1990Aug14.061951.25766@agate.berkeley.edu>, chopp@math.berkeley.edu writes: > I would like to play a sound asyncronously. I have Inside Mac V in my lap ^^^^^^^^^^^^ Here's problem #1: IMV lies. Get the Sound Manager document from sumex-aim.stanford.edu (maybe) or apple.com. It contains the chapter re-written to be correct. > and have written the following code using TC 4.0. Two things are wrong. > First, control is not returned to the program immediately (i.e. not played > asynchronously). Second, the SndDisposeChannel call causes a bomb. > Here's the code: > > #include > > void CSoundPane::DoClick(Point hitPt, short modifierKeys, long when) > > { > Handle theSound; > SndChannelPtr chan; > > theSound = GetResource('snd ', 2214); > chan = NULL; > SndNewChannel(&chan, sampledSynth, initSRate22k, NULL); ^^^^^^^^^^^^ Pass Zero for the synthesizer: Your 'snd ' resource probably already specifies the sampledsynth, and when the second one gets installed things go haywire. This is the cause of your problems. [stuff deleted] > Thanks in advance, > > Dave Chopp > chopp@math.berkeley.edu No problem, I've been just recently been playing with this myself. Here's a question for the rest of you: The Sound Manager document lists a whole pile of limitations of the "current sound manager", but also claims that it's from system version 6.0.2. Have any of those problems been fixed? --Chris (kempkec@mist.cs.orst.edu, despite what my header might say) Usual disclaimer applies, especially since my employer isn't who my mail header says it is...