Voice Recorder

  • Thread starter Thread starter William Ryan
  • Start date Start date
W

William Ryan

I've implemented the Voice Recorder control example that Neil Cowburn has
posted on various sites.

I'm having a weird problem that I can't re-create predictably. I used a
single instance class so I can set the filename dynamically, and it works
great 98% of the time. However, occassionally, it appends a ? to the end of
the filena me ie myfile.wav? When this happends, I can 't rename the file
or move it or anything. Manually, I can copy it via activesync and rename
it, but that's about it.

Has anyone else had this happen ? It also used the Beta character sometime.
Thanks again,

Bill
 
Hi Bill,

I'm encountering this issue as well - did you ever find out why this
was happening?

Thanks,

Joe
 
This is probably caused because the string is written to unmanaged memory
without a trailing null character, so the string read by the API includes
garbage characters. e.g.

//create buffer one character larger (to give a trailing null)
char[] temp = new char[waveFile.Length + 1];
Buffer.BlockCopy(wavFile.ToCharArray(),0,temp,0,2*wavFile.Length);

Peter
 
Back
Top