How to write an audio stream to a memory buffer instead of a file using DirectShow?

I made an example application that creates a filter graph to capture sound from a microphone and transfer it to a file. Is there any filter that allows me to pass to the memory buffer instead?

I follow the approach described in the msdn article and currently use the CLSID_FileWriter object to write sound to a file. This works well, but I cannot figure out how to write to the memory buffer.

Is there a memory receiver filter, or should I create one myself? (I would prefer one that is related to Windows XP)

+4
source share
2 answers

The easiest way to do this (though not the most elegant) is to use the Sample Grabber and then the Null Renderer Filter to complete the chart. This will allow you to access the feed stream using the grabber interface.

+5
source

Use IMediaSample :: GetPointer to get a pointer to raw buffer data.

0
source

Source: https://habr.com/ru/post/1303940/


All Articles