On Mon, 19 Apr 2004 10:20:35, Jeff Leal writes:
>Ok, basically what I want to do is play a system sound every K seconds,
>not a stream of any sort (hence the zero buffer size). However, I use
>the SndStreamCreate function to spawn a callback function that is called
>at a certain rate (see below). This plays the sound ok, but also a
>rattling effect.
...
>static Err sound_callback(void *userDataP, SndStreamRef stream, void
>*bufferP, UInt32 frameCount)
>{
>
> SndPlaySystemSound (sndWarning);
> return errNone;
>}
You might want to put frameCount worth of sound samples into bufferP
or else whatever garbage is in the buffer will also become a sound.
But if you only want a system sound every K seconds, why are you doing
this in a callback instead of from your event loop using TimGetTicks()?
IMHO. YMMV.
Ron Nicholson
HotPaw Productions
http://www.hotpaw.com/rhn/palm
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/