示例#1
0
        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 = "Остановить запись и распознавание";
            }
        }
示例#2
0
 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;
 }
示例#3
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (audioRecorder != null)
     {
         audioRecorder.StopRecording();
         audioRecorder = null;
     }
     listBox1.Items.Clear();
 }
示例#4
0
 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;
 }
示例#5
0
        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();
        }