On Mon, 17 Nov 2003 13:29:51, Monika Kauntz writes:
>I am trying to use the extended sound APIs to record data, do some
>processing on it and play out some audio. I am not recording or playuing
>back from a file but using buffers to store the data instead.
>My problem is that for example in playback I do not have all the data to
>play at once and it is not generated in the callback so I get interruptions
>in the playback.

Read up on packetized and streaming audio.  When streaming audio,
one obviously needs to get or generate audio samples at least as fast as
they are being sent to the D/A converter in order not to get any glitches
or interruptions in the sound waveform.  If you can't do this, you
can't avoid some interruptions (although telephone company R&D
labs have inventing many techniques for hiding them.)

When using the PalmOS Sampled Sound API's, if before starting your
sound you have one or two buffers pre-filled, and you keep filling them
at at least the rate your sound callback is emptying them, then your
callback will always have data available to copy to the sound channel to
avoid any glitches or interruptions.  Syncronization flags between
the various threads are useful for monitoring the buffer fill and use
rates.

When processing audio, you need to make sure the input buffers are
filled and processed before passing them to the output channel.  The
latency input to output will depend on the sample rate, the packet buffer
length and the speed of processing each packet buffer.


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/

Reply via email to