Is there any way to play audio directly into a capture device in C#? In my project I will have to feed later on a virtual capture driver with audio so I can use it in other programs and play the wanted audio anywhere else, but Im not sure it is possible in C#, I tried to do this with NAudio (which is truly amazing):
var enumerator = new MMDeviceEnumerator();
MMDevice captureDevice = enumerator.GetDefaultAudioEndpoint(DataFlow.Capture, Role.Multimedia);
WasapiOut wasapiOut = new WasapiOut(captureDevice, AudioClientShareMode.Shared, false, 0);
But ultimately it just throws a COMException
with the code 0x88890003
which translates to the error "The AUDCLNT_STREAMFLAGS_LOOPBACK
flag is set but the endpoint device is a capture device, not a rendering device". So in the end is there any possible solution or do I have to turn to another language like C++?