Problems with sound

John.Maloney at disney.com John.Maloney at disney.com
Mon Jun 7 19:33:43 UTC 1999


Paul,

Aha, I figured out what the problem is! There is a bug in
SampledSound (and probably LoopedSampledSound) the limits
the buffer size to about a million samples (roughly 45
seconds at 22050 samples/second). At this point, the
index into the buffer, which is represented in fixed-point,
becomes a large Integer, and the sampled sound playing primitives
fails (ungracefully, I'm afraid). Thus you get a full VM
crash.

I'm sorry that you ran into this bug. In the long term, the
bug should and will be fixed.

In the short term, you can work around it by constructing
a SequentialSound that strings together a bunch of SampledSounds
that are each smaller that 1 MByte each.

Incidentally, I started with the C code of Jutta Degener and
Carsten Bormann to create the Squeak GSM plugin, so the frame
format is exactly the same. I used their "gsm-1.0.10.tar"
(i.e., bug fix level 10). The extra 1/2 byte per frame is handled
the same way by both pieces of code (that is, the extra 4 bits
are just padded with zeros).

Good luck with your project!

	-- John





More information about the Squeak-dev mailing list