Hi All,

For PalmOS5.0, I tried using SndPlayResource in my game, but when sounds
overlapped there was a god-awful snapping and popping, and after 30
seconds or so, the device just locked solid.

My suspicion is that when many sounds are happening all at nearly the
same time, the buffers SndPlayResource uses are overwhelmed.

So, I've been investigating using SndCreateStream, and the callbacks,
but there are a few things I'm not sure about.

For example, what's a "frame"?  How big is it (1 bit?, 1 byte?)?  I know
the callback and call SndStreamStop on itself, but can code tell its
current status?  Can it delete itself?

My current plan is to have an array of 16 SndStreamRef's, and when I
need to play a game sound, either:
1) the first NULL stream ref is grabbed from the array, the stream is
started, the sound is played, and when done, the stream is stopped and
deleted.
2) the first stopped stream is started, and loads the first sound to be
played.  When that's done the stream is stopped again.

The first sounds like its making the Palm do a lot of work each time a
sound is called.  The second may not be possible, because I can't see
how to tell whether a given stream is started or not.

Anyone have example code that they can publish that explores this a bit?
Even the example code waves.c in the PalmOS5 SDK only uses
SndPlayResource.

-Ken


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to