• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1822
  • Last Modified:

How Do You Record Wav Files?

Hi all,

I could really do with some help, I'm trying to record sound from the microphone, and save it as a WAV file. My program already has WAV playing facilities (.Net 2.0 SoundPlayer, the easy bit) , and I'm analyzing the sound by reading in the binary file and following the WAV specification, as well as cutting the WAV file down and re-writing the file header - so I do get the basics of the format. My main problem is how to get the sound into a memory buffer, via the sound hardware, so that I can then create a WAV file header and save the file?

All help appreciated, and thanks for your time.
0
Shemmie
Asked:
Shemmie
  • 4
  • 2
  • 2
1 Solution
 
Bob LearnedCommented:
A full-duplex audio player in C# using the waveIn/waveOut APIs
http://www.codeproject.com/cs/media/cswavrec.asp

Bob
0
 
pgloorCommented:
If you want to spend some money I can recommend NCT Audio Studio, a package of 18 ActiveX Controls DLLs for work with audio data.

http://www.nctsoft.com/products/NCTAudioStudio2

You can download the library and test it for free. As long as you dont have a license key installed a dialog box will appear every now and then. Very annoying, but ok to give the library a try.

I found it easy to use from C# for an application where I had to read headerless G.726 files and convert them into compressed WAV files (ADPCM). It was the only working library I found that was able to deal with my G.726 files.

Peter
0
 
Bob LearnedCommented:
Peter,

Does that mean that they don't have .NET libraries?

Bob
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
pgloorCommented:
@TheLearnedOne:

At the time I used NCT Audio Studio (about half a year ago) they didn't have managed libraries.

Peter
0
 
Bob LearnedCommented:
Thanks, Peter.  I looked at http://www.nctsoft.com/, and they still have ActiveX controls--too bad :(  Sounded promising for me, since I am always on the hunt for good and cheap ;)

Bob
0
 
ShemmieAuthor Commented:
I appreciate the many comments on the topic, and apologies for a delay in responding.

So the only way to record a wav file from a .Net 2.0 application is to use InteropServices? I was hoping to keep Interop out of the application, as I'm hoping to port it to the Windows Mobile 5 / Compact Framework at a later date - is this at all possible?
0
 
Bob LearnedCommented:
I don't know enough about WM5 and CF to give you advice on that.

Bob
0
 
ShemmieAuthor Commented:
Rightie ho, with no new comments forthcoming, I'll award the points. Thanks again for the help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now