I am using NAudio, and i am currently playing around.
And now, i have a problem.
I record my mic to a memorystream.
When i click a button, it stops recording (to prevent write and read at the same time) And play from that memorystream.
But i don´t know how to tell it, when it has reached the end if should start over again.
So that after it has played, it will record my mic again, and i can redo the process.
Thanks
private void play_Click(object sender, EventArgs e)
{
StreamReader streamu = new StreamReader(waveStream);
//waveWriter.Close();
sourceStream.StopRecording();
// Wasout.Dispose();
waveStream.Seek(0, SeekOrigin.Begin);
//waveStream.Read(bytes, 0, waveStream.Length);
playwave = new NAudio.Wave.RawSourceWaveStream(@waveStream, sourceStream.WaveFormat);
waveOut2.Init(playwave);
//Aut.InitRecordAndPlayback(playwave, 2, 48000);
waveOut2.Play();
if (streamu.EndOfStream)
{
waveOut2.Dispose();
waveOut2 = new NAudio.Wave.DirectSoundOut();
sourceStream.StartRecording();
Wasout.Init(waveIn);
Wasout.Play();
}
}
This is what i am doing right now, and as you can see, i am messing around. And well, it doesn´t work;P