void Go() { int samplerate = 16000; int bits = 16; // 8 or 16 int channels = 1; // 1 or 2 filewriter = new WavFileWriter("out.wav", samplerate, bits, channels); WaveFormat fmt = new WaveFormat(samplerate, bits, channels); // devicenumber, wavformat, buffersize, callback int buffersize = 16384; WaveInRecorder rec = new WaveInRecorder(-1, fmt, buffersize, this.DataArrived); tmparray = new byte[buffersize]; Console.WriteLine("Recording - press Enter to end"); Console.ReadLine(); rec.Close(); filewriter.Close(); Console.WriteLine("Bye"); }