tags:

views:

30

answers:

1

Hi,

I have made a sample application which constructs a filter graph to capture audio from the microphone and stream it to a file. Is there any filter which allows me to stream to a memory buffer instead?

I'm following the approach outlined in an article on msdn and are currently using the CLSID_FileWriter object to write the audio to file. This works nicely, but I cannot figure out how to write to a memory buffer.

Is there such a memory sink filter or do I have to create it myself? (I would prefer one which is bundled with windows XP)

+1  A: 

The easiest way to do this (although not the most elegant) is to use a Sample Grabber filter followed by a Null Renderer filter to terminate the graph. This will enable you to get access to the raw media stream using the sample grabber's ISampleGrabber interface. Once you have the samples you can do what you like with them.

Stu Mackellar
Great, thanks! I really wish memory source/sink filters were available in the standard directshow/windows install.
yngvedh