Sound recording

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I want to create a program that records a sound track from the
microphone, and save it into a file.
Can anybody tell me please how do I get the audio from the microphone?
thanks for your help
 
The only way to do this is using p/invoke and the multimedia library. Take a
look at the waveIn<xxxxxx> functions.

Search for WimMM in MSDN. or Multimedia SDK.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
The only way to do this is using p/invoke and the multimedia library. Take a
look at the waveIn<xxxxxx> functions.

Search for WimMM in MSDN. or Multimedia SDK.

Hey Bob! MS just added some managed code support to the Oct DirectX SDK.
I've been waiting for them to get up to speed on managed code, and sure
enough, there's some examples in C#, including DirectSound. Long overdue.

I've tried using the WinMM library before, with mixed results. I'm hoping
that the .NET runtime speeds up a bit. Though I haven't traced the
problems I've experienced, they pretty much have to be coming from the
transition between unmanaged DLLs and managed code. I'm not sure what
..NET is doing there, or how to find out.

I was trying an approach closer to 'IJW' via layered C++ unmanaged/managed
DLLs (the latter accessed by the C# app). Maybe the p/Invoke/attribute
approach is faster, but I had a lot of various data types to transport, so
I tried to isolate them on the C++ side. Seemed slow. You wouldn't think
P/Invoke could be much faster than the IJW approach but maybe so.
 
Well pinvoke.net doesn't contain any of the functions I need.
THanks for ur help anyway...
Do u know if the Net frame work will contain functions for wave I/O?
Or is there some other way to do it?
 
Well pinvoke.net doesn't contain any of the functions I need.
THanks for ur help anyway...
Do u know if the Net frame work will contain functions for wave I/O?
Or is there some other way to do it?

I've already posted a suggestion about DX9, but Bob is correct about this.
P/Invoke is a mechanism that allows you to access older Win32 DLLs from
..NET. P/invoke is just the method to do this. It is not a sound lib.

All things considered, stick with the example code from the Oct DX9 SDK.
It does what you want already and it's in C#.
 
Back
Top