[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SOUNDly TRAPped





I, being new to both trap calls and sound manager routines, have a debugging
problem that may be simply my lack of experience in both areas and I beg your
forgiveness if I've forgotten to do/not done something obvious.

My problem is simple: I wish to play a 'snd ' resource (created with an older
version of MacREcorder or something) from within MCL 2.0. The code that I have
written does that fine -- once. If I try to do it 2 times or more in a row then
"anything goes" so to speak. 

The code I wrote is:

(with-pstrs ((res_file "sound-test.rsrc"))
   (#_openresfile :ptr res_file :word))

(rlet ((channel :pointer)
       (procptr :pointer))   ;;; no call back is used for now
      (#_sndnewchannel channel 0 0 procptr)
      (#_sndplay :ptr (%get-ptr channel) 
		 :ptr (#_getresource :ostype "snd " :word 12977 :ptr)
		 :word 0 :word)
      (#_snddisposechannel :ptr (%get-ptr channel) :word 0 :word))

Well, there it is. Any comment/suggestions/help would be greatly appreciated.

- Dan Griffin

dang@cs.brandeis.edu