How can I capture multiple audio buffer using iaudiocaptureclient and sinkwriter?

124 Views Asked by At

I tried to use sinkwriter to capture video and audio at the same time, and it worked, but I could only use one audio source. I would like to capture two or more different audio sources (system loopback and microphone for example).

What I tried was to create multiple mediaSamples via GetBuffer from each IAudioCaptureClient and put them in the sinkwriter. This did not work.

The other solution I thought of was to composite the pcm buffers from each GetBuffer into a single mediaSample, but this was very difficult.

My question is, how can I get the exact same start and duration of the buffer packets when I do a GetBuffer on each of the different IAudioCaptureClients?

I realize that the buffer lengths are different due to the difference in bitrate, but if the packets are of the same duration, I should be able to synthesize them.

If there is a better solution than this, please let me know.

0

There are 0 best solutions below