Playing AIFF sounds

Bob Arning arning at charm.net
Thu May 4 20:23:05 UTC 2000


On Thu, 4 May 2000 15:54:28 -0400 "David N. Smith \(IBM\)" <dnsmith at watson.ibm.com> wrote:
>However, when I run this a lot, playing four different sounds, sometimes a sound is played twice in a row, and on rare occasions it is played four times. They aren't just queuing up; the application never plays the same sound twice in a row. That is, I play A-B-C-A-B-C  and I might get A-B-C-A-B-B-C. The problem never repeats in the same place, and is rare, say 1 out of 20 times.

Dave,

I'll take a deeper look, but a quick possible explanation is this: the Mac VM uses two sound buffers so that it can be filling one while the SoundManager is playing the other. When the first buffer finishes, the other starts playing and Squeak can start refilling the first buffer with the next sound samples. If Squeak is delayed in doing that, the SoundManager will simply replay whatever is present from before. I have seen this happen when another Squeak process at the same (5) or higher priority prevents the SoundPlayer's PlayerProcess from the timely completion of its business. So some questions:

1. Any other processes running at or above 5?
2. Are the four sounds played concurrently or consecutively?
3. From the time you issue "s play" for the first sound until that sound completes, what else is happening? Are you decoding the next sound? Have you tried waiting for one sound to finish before doing anything else? (I know that may not be what you might want ultimately, but it may help pinpoint things).

Cheers,
Bob





More information about the Squeak-dev mailing list