winapiaudiodirectshow

DirectShow - how to save a buffer of recorded audio from AVI Mux filter instead of writing to file


I am writing a small DirectShow application in C++,

and i'm have a lot of trouble fetching the data of the recorded audio.

What i'm trying to achieve :

Microphone->Avi MUX filter->Data buffer->send buffer to server-> write data to an Avi file

How can this be done ? How can I fetch the raw buffer from the Avi Mux filter?

Help would be much appreciated

My current filter graph is built as follow, and it works:

Microphone -> Avi MUX filter -> File writer

This filter graph flow works fine, and i'm able to hear the recording.


Solution

  • Your question lack one important aspect. Are you going to send the data to server as content is being generated, or you want to send on completion and just bypass disk file creation.

    In either case you need an equivalent replacement for file writer filter, with your custom filter. SDK Dump Filter Sample [1, 2] might be a good starting point. You will have to extend it to better mimic file writer. This more or less addresses the second variant of mentioned above sending to server on recording completion.

    If you also want to send data as recording goes, you will have to put more effort and, probably, extend writer file more (possible, but makes no sense for me), or rather stop using AVI mux at all switching to sending some sort of half-processed content to server where it is combined into playable file and eventually stored.