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

write wasapicapture and wasapiloopbackcapture to the same file

Sep 11, 2015 at 10:30 PM
Edited Sep 11, 2015 at 10:31 PM
I'm trying to write the input from a WasapiCapture and WasapiLoopbackCapture to a wave file similar to http://stackoverflow.com/questions/19676932/naudio-recording-multiple-line-in. I don't want to write to separate files and then mix later but would rather mix before writing to 1 file. I'm having trouble wrapping my head around the more complex method described in http://stackoverflow.com/a/19679279. Can somebody give a more detailed example?
Sep 15, 2015 at 9:11 AM
It's fairly tricky to write, Basically when audio arrives from both sources, I'd put it into a BufferedWaveProvider. If both BufferedWaveProviders have more than a set amount of data in, mix that amount of audio into the mixed file. Otherwise wait for more to arrive. Then when recording ends, make sure you mix the last leftovers. I'm afraid I don't have a code sample to share at the moment.