This project has moved. For the latest updates, please go here.

Dictation Recorder using NAudio

Aug 29, 2008 at 9:05 PM
I'm looking to create a small dictation recorder in C# using NAudio. I'd liek to have the normal operations you'd expect in a dictation recorder - Play, Record, Pause, Rewind, Fast Forward.

My first question is - Is this something someone else has already done?  If it is, I don't want to reinvent the wheel, however has some searching, I have not found anything (opensource).

My Second Question is - The NAudio.Wave.WaveInStream is obviously for Recording, and the NAudio.Wave.WaveOut is for playback, but is there anything that can do both? Record and Play?

NAudio.Wave.WaveInStream is not repositionable - which means that calls toWaveInStream.Seek will fail - So no Rewind/Fast Forward on that stream.

Thanks,
Adrian



Coordinator
Aug 31, 2008 at 9:27 PM
Hi there,

the way I would go about implementing this would be to write all the audio that is captured to a wave file. Then a completely separate wave stream should play back from that file (and needs to cope with the fact that it is growing in length). This way you could arbitrarily pause and reposition playback as you require.

Mark
Sep 2, 2008 at 2:05 PM
Mark,

Using the two streams, one for input and one for output makes sense. That's pretty much what I figured I'd have to do. What I'm stuck on is how would I go about repositioning the input stream when the back button is pressed. eg: You have recorded 60 seconds, and you want to skip back and record over the last 15 seconds of the recording. From what I know, you can't just reposition the input wave.

Thanks,
Adrian
Coordinator
Sep 3, 2008 at 11:28 PM
Your recording stream should be writing to a WaveFileWriter. What you want is to be able to reposition the WaveFileWriter backwards so it can overwrite what has already been written. I would need to have a look at the code to see what happens in this scenario, as it would need to keep correct track of the Wave File length and position.