Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!mullian.ee.mu.OZ.AU!iand From: iand@mullian.ee.mu.OZ.AU (Ian Robert DOBSON) Newsgroups: comp.sys.mac.programmer Subject: HELP - Asynchronous Sound Manager Calls Keywords: sound snd Message-ID: <6797@munnari.oz.au> Date: 18 Feb 91 01:20:57 GMT Sender: news@cs.mu.oz.au Reply-To: iand@mullian.ee.mu.OZ.AU (Ian Robert DOBSON) Organization: Dept. of Electrical Engineering, University of Melbourne Lines: 26 I am writing a program which must be able to play sounds asynchronously when in both the foreground and background (it's a BBS system - I need to alert the system operator when a remote user wants to chat) I have tried using the Sound Manager as follows: 1. Allocated a sound channel 2. Issued a SndPlay call with a TRUE for the 'async' parameter 3. Added a completion callBack routine into the queue. The callback routine sets a global flag saying the sound is finished playing. 4. Go through the main event loop until the sound is finished. 5. Deallocate the sound channel Trouble is, when the sound is playing and a context switch occurs (eg. I click on a window from another application) or when After Dark switches in, the system bombs. I have seen other applications doing what I want (eg. QuickGIF) so I know it's possible to do. Can anybody tell me what is going wrong? Please send e-mail Ian R. Dobson University of Melbourne iand@mullian.ee.mu.OZ.AU