private void btnRecord_MouseDown(object sender, MouseEventArgs e) { lblRecordStatus.Text = "RECORDING..."; lblRecordStatus.ForeColor = Color.Red; tmrRecording.Enabled = true; if (dgvSentences.SelectedRows.Count < 1) { return; } if (!Directory.Exists(audioDir)) { Directory.CreateDirectory(audioDir); } wavAudio = new RecordWaveAudio(audioDir, dgvSentences.CurrentRow.Cells[0].Value.ToString(), cmbInputDevices.SelectedIndex); wavAudio.Start(); }
private void button1_Click(object sender, EventArgs e) { if (button1.Text == "Gravar") { button1.Text = "Parar"; audio = new RecordWaveAudio(Application.StartupPath, "TESTE"); audio.Start(); } else { if (audio != null) { audio.Stop(); audio = null; } button1.Text = "Gravar"; } }