Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8128301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:49:57+00:00 2026-06-06T07:49:57+00:00

Basiclly I just want to capture audio and save it to a file on

  • 0

Basiclly I just want to capture audio and save it to a file on disk. I came to the conlusion using the AVI format would be best and least annoying. After wading through the DirectShow API, this is what I came up with.

//I find the mic in previous code
hr = pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void**)&pSrc);

hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void**)&pGraph);
//Initialize the Capture Graph Builder
hr = pBuild->SetFiltergraph(pGraph);

IBaseFilter *pMux;
//IFileSinkFilter *pSink;
hr = pBuild->SetOutputFileName(
    &MEDIASUBTYPE_Avi,  // Specifies AVI for the target file.
    L"C:\\Example.avi", // File name.
    &pMux,              // Receives a pointer to the mux.
    NULL);              // (Optional) Receives a pointer to the file sink.


hr = pBuild->RenderStream(
    &PIN_CATEGORY_CAPTURE, // Pin category.
    &MEDIATYPE_Audio,      // Media type.
    pSrc,                  // Capture filter.
    NULL,                  // Intermediate filter (optional).
    pMux);                 // Mux or file sink filter.

Now, I figured this would be enough to do what I wanted but no file is created on disk and RenderStream gives me E_INVALDARGS. If I change the function call to:

hr = pBuild->RenderStream(
    NULL, // Pin category.
NULL,      // Media type.
    pSrc,                  // Capture filter.
    NULL,                  // Intermediate filter (optional).
    pMux);                 // Mux or file sink filter.

I get the VFW_E_NOT_IN_GRAPH error instead.

What am I doing wrong here? I’d be outmost grateful for any help, thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:50:01+00:00Added an answer on June 6, 2026 at 7:50 am

    VFW_E_NOT_IN_GRAPH means that you need to add your pSrc filter you created to the filter graph using IGraphBuilder::AddFilter call.

    To save audio-only stream into file, you might want to prefer .WAV format instead, Windows SDK comes with WavDest project/sample which can accept audio from audio filter and output a .WAV file stream compatible with File Writer Filter to save into file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to monitor elasticsearch using nagios. Basiclly, I want to know if
Basically i just want to do an arbitrary operation using given arguments of arbitrary
I want to capture the base path of a given url http://mydomain.com/mypath/coolpath/favoritepath/file.htm so basically
Basically I just want to check if one time period overlaps with another. Null
I just basically want to add about 20 and sometimes 80 Proximity Alerts with
I just want to design this very simple website. Basically there are multiple pages
Basically, I just want to know if its possible to use Nhibernate to migrate
I basically want to make things easier by just looping LinkButtons instead of making
Basically just looking to see if you can capture an image from the webcam
I basically just want to take a 8 character ASCII value 003fc000 and convert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.