Hi all,
I'm trying to implement a voice recording function. Basically it's
supposed to record the WAV and write it out to the file, at which
point LAME will kick in and convert it to MP3.
The only problem is that I'm having issues writing it out. I'm using
this code as a base: http://www.eggheadcafe.com/articles/20050611.asp
It records fine and I can play it back through my speakers, but when I
try to export it, Windows Media Player doesn't recognize the file and
LAME converts it into a long screeching sound. This is the code I'm
trying:
FileStream fs = File.OpenWrite("try.wav");
fs.Write(RecordStream.GetBuffer(), 0, (int)RecordStream.Position);
fs.Close();
I've also tried this with the same result:
fs.Write(RecordStream.ToArray(), 0, (int)RecordStream.Length);
Any ideas?