I am using P/Invoke to do audio capture on my Pocket PC PDA. Specifically, I am using functions such as waveInOpen, waveInPrepareHeader, waveInStart, etc. When the system sends a message signaling that a buffer has been fillied, I attempt to look at the data in the buffer by doing a Marshal.Copy, giving it the starting address and length of the buffer. If I let the system fill any number of buffers before doing Marshal.Copy, things are fine - the data looks great. The problem comes when I try to Marshal the data from memory while recording buffers at the same time. Any buffers recorded after the first Marshal.Copy contain corrupted data, even though I am certain that I am only Marshalling data from completed buffers. Any help would be greatly appreciated.
-Matt
-Matt