private void button1_Click(object sender, EventArgs e) { if (audioRecorder != null && audioRecorder.isRecording) { if (timer != null) timer.Stop(); audioRecorder.StopRecording(); bLen = audioRecorder.bLen; channels = 1; b = audioRecorder.b; audioRecorder = null; button1.Text = "Начать запись и распознавание"; } else { audioRecorder = new AudioRecorder(comboBox1.SelectedIndex); audioRecorder.StartRecording(); timer = new Timer(); timer.Interval = 1000; timer.Tick += timer_Tick; timer.Start(); viewMatches(); button1.Text = "Остановить запись и распознавание"; } }
private void button3_Click(object sender, EventArgs e) { audioRecorder = new AudioRecorder(listBox1.SelectedIndex-1); audioRecorder.StartRecording(); button3.Enabled = false; button2.Enabled = true; button4.Enabled = true; }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (audioRecorder != null) { audioRecorder.StopRecording(); audioRecorder = null; } listBox1.Items.Clear(); }
private void button4_Click(object sender, EventArgs e) { audioRecorder.StopRecording(); if (timer != null) timer.Stop(); bLen = audioRecorder.bLen; channels = 1; b = audioRecorder.b; button3.Enabled = true; button2.Enabled = true; audioRecorder = null; button4.Enabled = false; }
private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { if (audioRecorder != null) { audioRecorder.StopRecording(); audioRecorder = null; } if (listBox1.SelectedIndex == 0) { panel1.Visible = true; panel2.Visible = false; } else { panel2.Visible = true; panel1.Visible = false; } listBox2.Items.Clear(); }