Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!ub!uhura.cc.rochester.edu!rochester!pt.cs.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!jp57+ From: jp57+@andrew.cmu.edu (Jefferson Provost) Newsgroups: comp.sys.mac.programmer Subject: Sound Manager: Who knows what evil lurks? Message-ID: Date: 5 Feb 91 01:11:39 GMT Organization: Carnegie Mellon, Pittsburgh, PA Lines: 62 Hi, Does anyone out there know what _really_ goes on in the depths Sound Manager? I have the replacement IM chapter on the Sound Manager that is dated 2 October 1988 (but which is apparently newer than that), and I find it woefully inadequate for my purposes. There are a number of things I need to know, but most importantly is this: I have an external device providing me with interrupts precisely every millisecond, with which I increment a counter to provide the program with a millisecond-accuracy timer. What I'd like to do be able to know the to the millisecond when a sound started. The sound is a plain sampled sound buffer (not a 'snd ' resource) that I build in memory from data read in from a file. Currently, I build the bufferCmd to play the sound, then save the current value of the millisecond-timer, and do a SndDoImmediate to play the buffer. Unfortunately, my timing (using the same device that provides me with the millisecond counter) tells me that the sound starts anywhere from 6 to 20 milliseconds after I tell it to. If the overhead were constant, I think that would be OK, but it isn't constant, it seems to vary greatly. My big questions are: What's the delay? And is there some way to make it constant? Also, I've heard that the Apple sound hardware always plays samples at a certain rate, and if you play sounds at different sampling rate than that, it has to throw away samples or create new samples, or in some other way convert your sound to its sampling rate. Is this true? If so, what's the sampling rate of the hardware? The sound manager literature that I have leads me to believe that it's 22254.5454, but I don't know for sure. Third, have there been changes to the Sound Manager (hardware or software) since the last revision of the documentation? I have a brand new SI running system 6.0.7. With this machine, ampCmd works to change the volume of buffered sounds, even though the documentation says that it doesn't. I wonder what other things are different. There are a couple of other things (like the fact that my call-back routine comes back before the sound has finished playing) but this is enough for now. Any help, pointers or worthwhile documentation of any kind will be appreciated. Thanx, Jeff +------------------------------------------------------------------------------ + |Jefferson Provost | jp57+@andrew.cmu.edu |"I had my hand on a dollar bill | Psychology | (412) 268-3139 |and the dollar bill flew away, | Carnegie Mellon |----------------------|but the sun is shining down on me | Pittsburgh, PA 15213 |-=-=-=-=-=-=-=-=-=-=-=|and it's here to stay" +------------------------------------------------------------------------------ +