Ejemplo n.º 1
0
        private void StartListening()
        {
            int sampleRate = 6000;
            int fftSize    = 1 << (9 + cbFftSize.SelectedIndex);
            int stepSize   = fftSize / 20;

            pbSpectrogram.Image?.Dispose();
            pbSpectrogram.Image = null;
            listener?.Dispose();
            listener             = new Listener(cbDevice.SelectedIndex, sampleRate);
            spec                 = new SpectrogramGenerator(sampleRate, fftSize, stepSize);
            pbSpectrogram.Height = spec.Height;

            pbScaleVert.Image?.Dispose();
            pbScaleVert.Image  = spec.GetVerticalScale(pbScaleVert.Width);
            pbScaleVert.Height = spec.Height;
        }