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(); }
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(); }
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(); }); }
private void buttonBuffer_Click(object sender, EventArgs e) { detector = new EnergyBeatDetector(int.Parse(textBoxBuffer.Text)); detector.Beat += new EventHandler(Detector_Beat); }