DirectShow sound recording from microphone + stereo mix

I am trying to write code to capture a microphone and stereo mix with DirectShow filters. First I try to configure filters using GraphEdit from the Windows SDK. I installed the capture devices on the microphone and stereo mix, then connect the Capture pins from both of them to the 01 inputs and the 02 AVI Mux input, and then connect the AVI Out pin to the contact of the Writer file. When I run the chart, I get

This graph cannot be played. Unspecified error (Return code: 0x80004005)

I looked for this error quite a bit, and I can not find the answer.

If I try to associate them separately with the WAV Dest filter for each of them, I get the same error. For some reason I cannot understand, this will not allow me to capture both. Is StereoMix emulating a microphone when I remove it?

If I try to capture them one at a time, it works, but I need to capture both at the same time. If I installed a microphone to output to the speakers, then I can record both of them, but this does not really help me, because the user can hear themselves in the speakers, which can really distract.

I also tried and recorded a loop with WASAPI, but I need some backward compatibility, since loop recording with WASAPI only works for Vista or Windows 7.

I looked at PortAudio and FFmpeg , but I can not afford to complicate the program more than it is. What should I do?

+4
source share
1 answer

I did some more research. Apparently, this is really a bad situation. I did not find an answer about DirectShow filters.

Some computers do not have sound cards that support StereoMix. The only solution that will work in Windows XP is to create a virtual audio driver using the Windows DDK, setting it as the default device, passing the buffer to the real audio device (so as not to interfere with the audio output) and my application.

At the same time, I can use the DirectShow filter to capture microphone sound.

Here is Microsoft's documentation on sound drivers: http://msdn.microsoft.com/en-us/library/windows/hardware/ff537871%28v=vs.85%29.aspx

I do not know much about these issues. Hope this helps anyone who has the same situation. If anyone has any other suggestions, please let me know.

0
source

All Articles