by PsychoStorm » Jun 21, 2001 @ 1:58pm
I actually made a lot of progress in using the waveOut stuff. Let me pass along a few observations I made that were not immediately obvious to me:<br><br>- the prepareHeader / waveOutWrite / WOM_DONE message / UnprepareHeader is an _atomic_ unit of execution. I tried using the waveOutWrite twice with the same header and it worked fine on the emulator, crashed my IPAQ completely.<br><br>- As everyone has observed, the WOM_DONE callback that the low-level stuff raises is difficult to debug. You can't breakpoint it or anything - best thing is to keep it simple.<br><br>- I believe you CAN waveOutWrite two buffers consecutively, and this is how you keep the audio out device continually fed with buffers - once the WOM_DONE message is sent for the first buffer (done playing), you can prepareHeader / waveOutWrite another buffer and at that point and it will end up being the third one.<br><br>I intend to finish my simple MP3 player, but now I'm itching to make a mini waveOut API that incorporates mixing of sound effects. i.e., you pass a PCM buffer to the API, and it plays it asynchronously. If indeed mixing is as simple as adding them all together (using the API to get the current sound position so as to enforce a constant 100ms lag, for example), it shouldn't be too difficult.<br><br>- Richard