コード例 #1
0
        void Button1Click(object sender, EventArgs e)
        {
            AudioDeviceInfo info = comboBox1.SelectedItem as AudioDeviceInfo;

            if (info == null)
            {
                MessageBox.Show("No audio devices available.");
                return;
            }


            source                  = new AudioCaptureDevice(info.Guid);
            initializing            = true;
            lbStatus.Text           = "Waiting for soundcard...";
            source                  = new AudioCaptureDevice(info.Guid);
            source.SampleRate       = 44100;
            source.DesiredFrameSize = 5000;
            source.NewFrame        += source_NewFrame;


            detector       = new EnergyBeatDetector(43);
            detector.Beat += new EventHandler(detector_Beat);


            sample = new List <ComplexSignal>();

            source.Start();
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: xyicheng/Accord
        void Button1Click(object sender, EventArgs e)
        {
            AudioDeviceInfo info = comboBox1.SelectedItem as AudioDeviceInfo;

            if (info == null)
            {
                MessageBox.Show("No audio devices available.");
                return;
            }


            source = new AudioCaptureDevice(info.Guid);
            initializing = true;
            lbStatus.Text = "Waiting for soundcard...";
            source = new AudioCaptureDevice(info.Guid);
            source.SampleRate = 44100;
            source.DesiredFrameSize = 5000;
            source.NewFrame += source_NewFrame;


            detector = new EnergyBeatDetector(43);
            detector.Beat += new EventHandler(detector_Beat);


            sample = new List<ComplexSignal>();

            source.Start();
        }
コード例 #3
0
        private void buttonStart_Click(object sender, EventArgs e)
        {
            this.Invoke((MethodInvoker) delegate()
            {
                AudioDeviceInfo info = comboBoxMicrophoneSource.SelectedItem as AudioDeviceInfo;

                if (info == null)
                {
                    MessageBox.Show("No audio devices available.");
                    return;
                }


                source                  = new AudioCaptureDevice(info.Guid);
                initializing            = true;
                labelAudioStatus.Text   = "Audio Status: Waiting for soundcard...";
                source                  = new AudioCaptureDevice(info.Guid);
                source.SampleRate       = 44100;
                source.DesiredFrameSize = 5000;
                source.NewFrame        += Source_NewFrame;

                detector       = new EnergyBeatDetector(43);//changed from 43 //could change this to make is longer or shorter segments that are analyzed.
                detector.Beat += new EventHandler(Detector_Beat);

                source.Start();
            });
        }
コード例 #4
0
 private void buttonBuffer_Click(object sender, EventArgs e)
 {
     detector       = new EnergyBeatDetector(int.Parse(textBoxBuffer.Text));
     detector.Beat += new EventHandler(Detector_Beat);
 }