Discussion:
Capture audio to WAV file
(too old to reply)
Bob
2008-09-06 07:07:59 UTC
Permalink
I'd like to find samples of code for capturing audio (from mic or
input channel) to a .WAV file.

It would be a plus to find this in C#, using the DirectShow.net lib.

Anything?
Mark Salsbery [MVP]
2008-09-06 19:23:09 UTC
Permalink
Post by Bob
I'd like to find samples of code for capturing audio (from mic or
input channel) to a .WAV file.
It would be a plus to find this in C#, using the DirectShow.net lib.
DirectShow doesn't come with a filter to write WAV files (AFAIK) but there
is a sample filter that does:

WavDest Filter Sample
http://msdn.microsoft.com/en-us/library/ms788110(VS.85).aspx


Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
Post by Bob
Anything?
Bob
2008-09-06 23:58:20 UTC
Permalink
On Sat, 6 Sep 2008 12:23:09 -0700, "Mark Salsbery [MVP]"
Post by Mark Salsbery [MVP]
Post by Bob
I'd like to find samples of code for capturing audio (from mic or
input channel) to a .WAV file.
It would be a plus to find this in C#, using the DirectShow.net lib.
DirectShow doesn't come with a filter to write WAV files (AFAIK) but there
WavDest Filter Sample
http://msdn.microsoft.com/en-us/library/ms788110(VS.85).aspx
Thanks, Mark. I checked the WaveDest filter (compiled from the latest
Windows SDK), and I can get it to work. But it's extremely touchy.
When test-patching things in GraphEdt, it will initially connect, but
if the pins are disconnected, it cannot be reconnected. It gives a
message about no compatible formats. I have to delete the WaveDest
filter and reload it. Then it's good for one more connect. Strange,
eh?

It also seems to interfere with connection of other filters in a
chain, causing them to issue the same type of message. When WaveDest
is removed, the other filters hook up fine.

Seems like I'd have to account for the strange behavior if I use it in
an app. And it's tough to say what's causing the quirks.

I was hoping that there was something built in, but if not, is there a
way to solve the problem with WaveDest?
The March Hare [MVP]
2008-09-08 15:26:43 UTC
Permalink
Post by Bob
I'd like to find samples of code for capturing audio (from mic or
input channel) to a .WAV file.
...

Please do not crosspost without checking the groups you are posting to. A
quick check will show:

microsoft.public.multimedia.directx.dshow.programming

has been inactive for years.

See: http://tmhare.mvps.org/help.htm#cp

And the link below.

Follow up set to:

microsoft.public.win32.programmer.directx.audio
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
Loading...