This project has moved. For the latest updates, please go here.

WasapiLoopbackCapture Dropouts

Jan 9, 2013 at 8:52 PM


I experience dropouts in irregular time spans when I try to record via WasapiLoopbackCapture (tried on three PCs - even on a intel core i7 in idle mode). Does anyone have an idea on how to fix this problem?

Thanks in advance.

Jan 11, 2013 at 12:40 PM

do you mean missing samples, or recording samples that have a value of 0? How long do you have to record before this problem is observed? Is there any chance it could be coinciding with a run of the .NET garbage collector?


Jan 11, 2013 at 2:22 PM

Thank you very much for your reply!

I mean missing samples (like the original sound from the computer is: ABCDEF and the recording is like ABDEF). Sometimes it occurs after 10 seconds, sometimes after 2 minutes and sometimes I get a record without any issue... In the DataAvailable Method I just write the buffer to the file with writer.Write(e.Buffer, 0, e.BytesRecorded); ...

Thank you very much for your help!

Jan 11, 2013 at 9:28 PM

hmmm, not sure what is causing that. It might possibly be the garbage collector, in which case recording with larger buffer sizes might help, although unfortunately that isn't currently configurable in WasapiCapture, which is something that probably ought to be rectified in a future NAudio.