Hello,
I'm having exactly the same problem but I think I have found the cause (but not the solution :(), listen up:
I'm using two buffers:
a cyclic capture buffer (CaptureBuffer) to captureSound and,
a cyclic playback buffer (SecondaryBuffer) to play the sound.
The captureBuffer has 4 (could be any other number) notifyPositions distributed within the buffer. when data is written to this position a notification is sent to a thread that will copy data from the captureBuffer to the playbackBuffer so it can be played right away, so data is copied in chunks (4 chunks and then begin at the position 0 of the buffers, because there are 4 notification positions).
Now the playBuffer has a write position which is the position ahead of which is safe to write data (so you dont overwrite data that is being played). The problem is here: the playPosition moves slower than the writePosition so eventually you will begin writing to a position < playPosition and thats when the gaps in audio begin. The difference in the velocity of this pointers can be very slow so its hard to notice, but there is a difference which is increased if I add Effects.
How can we fix this? Which is the best way to do this? I've heard of FullDuplex class but I haven't tryed it yet.
Thanks in advanced,
JC.