This project has moved and is read-only. For the latest updates, please go here.

Naudio circular buffer?

Mar 20, 2016 at 2:55 PM
I have previously used a circular capture buffer to sample audio using DirectSound. Is that functionality available in Naudio? Ideally I would like a 5 second circular buffer that I can "dip" into every 200mS. Occasionally the interval might be longer. Obviously I would need a pointer to the data that has arrived since the last time I checked it. In DirectSound I can use "GetCurrentPosition" of the capture buffer. Does Naudio support anything like that?

Many thanks.

Mar 21, 2016 at 10:10 PM
NAudio offers a "BufferedWaveProvider" for that task, which behind the scenes used a circular buffer.
This class got improved some time ago and should be thread-safe now if I remember correctly.
Mar 22, 2016 at 8:02 PM
Many thanks for that Freefall. I will look into the BufferedWaveProvider.