The below is my sample code to record audio coming from a speaker. It is working fine. But it is recording audio only when some audio is coming out from speaker. If there is no audio then it is not recording. Actually i am doing screen recording with system's voice. The length of audio recorded by wasapiloop is mismatching with screen recording length because wasapiloop is recording audio only when there is sound from speaker.
WasapiCapture waveLoop = new WasapiLoopbackCapture();
waveLoop.Initialize();
waveLoop.DataAvailable += waveLoop_DataAvailable;
waveLoop.Stopped += waveLoop_Stopped;
waveLoop.Start();
I have seen one similar stack over flow question but i did not understand it fully.
CSCore loopback recording when muted
Any help is greatly appreciated.