//Sets up a listener for the selected microphone and initializes a spectrogram display public void StartListening() { int sampleRate = Int32.Parse(sampleRates[cbSampleRate.SelectedIndex]); int fftSize = 1 << (9 + cbFFTsize.SelectedIndex); int stepSize = fftSize - (int)(fftSize * overlap); listener?.Dispose(); listener = new Listener(cbMicInput.SelectedIndex, sampleRate); spec = new Spectrogram.Spectrogram(sampleRate, fftSize, stepSize); if (cmaps != null) { spec.SetColormap(cmaps[cbCmaps.SelectedIndex]); //todo this is a hack for this running before SpecInit } stft = new FFTs(spec.GetFFTs(), spec.SampleRate, spec.StepSize, spec.GetWindow()); }