2

I am just starting to learn DirectShow with C++. I need to use DirectShow to record the audio and write it to a WAV file on the disk. I heard from other people that Win 7 does not allow for rendering audio using DirectShow.

In addition, I would like to know how should I start with recoding audio using DirectShow with C++? If there is sample source, it would be great.

Thanks in advance.

asked Nov 4, 2011 at 1:09

1 Answer 1

4

I think you may have misunderstood these other people. Windows Media Foundation is aimed to be the successor of DirectShow, but DirectShow is still a very valid technology on Windows 7.

The easiest thing to accomplish what you want to do, is to get it right using the GraphEdit tool first ( I assume you want to do this programmatically).

Create a graph that contains your audio device, a WavDestFilter, and a file writer.

Source -> WavDest -> File Writer

Play the graph. Stop the graph and you should have created a .wav file with the recorded audio. If you can get this right, then you need to do the whole thing programmatically. There are a couple of samples in the SDK that show you how to programmatically add filters to a graph and connect them, that should enable you to get started.

WRT the WavDestFilter, IIRC it might not be in all versions of the SDK, you'll have to find an appropriate one. You also need to build it, and regsvr32 it, so that it will show up in your list of available filters in GraphEdit.

If this all seems a bit much, I would read through the DirectShow documentation on MSDN to at least get an overview of DirectShow.

answered Nov 4, 2011 at 4:55
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.