This is called loopback recording , and it is possible on Windows. If you have a sound card that supports loopback (I just tested it on my younger Toshiba laptop, and it’s not), you can record directly from your loopback device using the waveInOpen API, etc., which is easy to use in C # , Note: Recording sound in this way necessarily results in lower quality, since the audio signal is converted to analog for output, and then re-digitized to support the loopback interface.
If you do not have a sound card, WASAPI will allow you to do this. I suppose WASAPI can be used with C #, but it looks painful.
source share