Program a recorder in C#

  • Thread starter Thread starter jujulaustralienne
  • Start date Start date
J

jujulaustralienne

I know many people have managed to this but no one has posted the code
on the internet.
I used the codeproject program:
http://www.codeproject.com/cs/media/cswavrec.asp to start with. The
problem is that this program records and plays back right away. What I
want to do is to record and save it to a wave file. I used one of the
comments made on the codeproject page:
http://www.codeproject.com/cs/media/cswavrec.asp?msg=919013#xx919013xx
(at the bottom of the page) but it doesn't help.
So what my program does right now is: record a sound, save it into a
file but when I play the file it's just noise. I checked the header of
the file and the data written in the file and it's all good. I changed
the parameters (frequency, number of channels etc) but it doesn't
change anything.
Has anyone had the same problem and can you guys help me? (I can send
the code by email)
Thanks
 
When you save PCM audio to a "wav" file, it needs to have a Wav header
(usually the first 44 bytes, but it can vary). This header describes the
format, number of channels, bitrate, and most importantly, the length of the
raw audio stream that follows.
Peter
 
Back
Top