Exemplo n.º 1
0
        private void StartCapture()
        {
            welcomeLabel.Visible = false;

            try
            {
                SetupDisplay();

                SoundCaptureDevice device = GetSelectedCaptureDevice();

                source                   = new CapturedSoundInfoSource(device);
                source.SampleRate        = properties.SampleRate;
                source.Window            = properties.Window;
                source.Delta             = properties.Delta;
                source.SpectrographData += new EventHandler <SpectrographDataEventArgs>(source_SpectrographData);
                source.Listen();

                isCapturing = true;

                UpdateMenu();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable to start capture: " + ex.Message);
            }
        }
Exemplo n.º 2
0
 internal Adapter(CapturedSoundInfoSource owner, SoundCaptureDevice device, int window, int delta)
     : base(device)
 {
     this.owner        = owner;
     this.windowBuffer = new SlidingWindowBuffer(window, delta);
     this.buffer       = new double[window];
 }
 internal Adapter(CapturedSoundInfoSource owner, SoundCaptureDevice device, int window, int delta)
     : base(device)
 {
     this.owner = owner;
     this.windowBuffer = new SlidingWindowBuffer(window, delta);
     this.buffer = new double[window];
 }
Exemplo n.º 4
0
        private void StopCapture()
        {
            source.Stop();
            source.SpectrographData -= new EventHandler <SpectrographDataEventArgs>(source_SpectrographData);
            source = null;

            isCapturing = false;
            UpdateMenu();
        }
Exemplo n.º 5
0
        private void StopCapture()
        {
            source.Stop();
            source.SpectrographData -= new EventHandler<SpectrographDataEventArgs>(source_SpectrographData);
            source = null;

            isCapturing = false;
            UpdateMenu();
        }
Exemplo n.º 6
0
        private void StartCapture()
        {
            welcomeLabel.Visible = false;

            try
            {
                SetupDisplay();

                SoundCaptureDevice device = GetSelectedCaptureDevice();

                source = new CapturedSoundInfoSource(device);
                source.SampleRate = properties.SampleRate;
                source.Window = properties.Window;
                source.Delta = properties.Delta;
                source.SpectrographData += new EventHandler<SpectrographDataEventArgs>(source_SpectrographData);
                source.Listen();

                isCapturing = true;

                UpdateMenu();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable to start capture: " + ex.Message);
            }
        }