You'll need to inform the callback how much data you've actually written.  So 
for your callback it would be this:
*bufferSizeP = 4000;

Also, you'll have to be aware that the *bufferSizeP variable might be larger 
or, depending on conditions, actually smaller than your 4000 bytes.  So if the 
*bufferSizeP on input is 2048 bytes, you'll be overwriting the sound buffer by 
1952 bytes!

When you create the soundstream, the buffer size request is just that...a 
request.  The system can allocate what it wants so you'll need to always test 
the *bufferSizeP input variable.

You'll have to keep track in your userData how much of the buffer you have 
written and how much of the raw data is left.  And when you're done writing to 
the sound buffer you'll have to terminate it with *bufferSizeP = 0;

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

Reply via email to