// Method that stops recording private void stop_Click(object sender, EventArgs e) { Recognition_Form form = new Recognition_Form(null, null, null); form.Show(); this.microResultLabel = form.ms_result; this.mfcc_result = form.mfcc_result; this.lpc_result = form.lpc_result; if (sourceStream != null) { sourceStream.StopRecording(); sourceStream.Dispose(); sourceStream = null; } if (waveWriter != null) { waveWriter.Dispose(); waveWriter = null; } openWav(wavSaveName); recording_timer.Stop(); wavSaveName = null; System.Threading.Tasks.Task.Run(() => { processWavFile(algo); }); // processWavFile(algo); }
private void stream_record_Click(object sender, EventArgs e) { Recognition_Form form = new Recognition_Form(null, null, null); form.Show(); this.microResultLabel = form.ms_result; this.mfcc_result = form.mfcc_result; this.lpc_result = form.lpc_result; if (global != null) { global.Dispose(); } ///DisposeWave(); recording_timer.Start(); start = DateTime.Now; initRecord(true); sourceStream.StartRecording(); microsoft_recognition_from_stream(); }