RE: [GD-Windows] Streaming WAVE audio
Brought to you by:
vexxed72
From: Jon W. <hp...@mi...> - 2002-04-27 23:07:26
|
> CALLBACK_FUNCTION I suppose you mean CALLBACK_THREAD when you're actually using a thread. Have you tried CALLBACK_EVENT and WaitForSingleObject as an alternative, btw? > Any suggestions on what else to look for that could be causing problems? Poor drivers? Having had access to WinCE drivers as "reference code" when writing device drivers, I'm underwhelmed by some of the vendors' approaches to quality. Others do OK. Another thing to try is to use at least three buffers, possibly four, because some drivers may have implementation issues with you handing it "only" one fresh buffer of advance queue. Also try to make the buffers powers of two in size, to work around some classes of bugs. You also should not prepare a header more than once; prepare all the headers on start-up, then call waveOutWrite() in a cyclic fashion. You're probably already doing this right. It may be that preparing a header that has already been prepared is not the efficient no-op you'd want it to be. Another thing to look for is internal logic errors where you play the "wrong" buffer, and/or get out of sync if you miss one buffer. The safest and most predictable way to do this is to always copy data from the mixer function, and fill all buffers with zero before you start the device, rather than trying to pre-fill buffers with data. While this will result in a startup latency equal to the steady-state latency and some people think this is a draw-back, I think it's the right thing to do. Last, you can poll the WHDR_DONE bit in the headers for the buffers, rather than relying on a callback to fill the buffers. This lets you use a model slightly closer to that of DirectSound. Let us know when you find out what it is! Cheers, / h+ |