private void SaveSpectrogram() { PauseSpectrogram(); SaveFileDialog saveFile = new SaveFileDialog { Filter = "wav files(*.wav)| *.wav| All files(*.*) | *.* ", FilterIndex = 1 }; if ((bool)saveFile.ShowDialog()) { string filename = saveFile.FileName; FFTs stft_copy; if (selectedIndices.Exists()) { (int t1, int t2, _, _) = selectedIndices.Indices(); stft_copy = stft.Copy(t1, t2 - t1); } else { stft_copy = stft.Copy(); //To not apply the gain to the spectrogram } stft_copy.SaveToWav(filename); } }
public void ApplyGain(double dbGain, bool applyToWindow = false) { FFTs stft = parentRef.GetSTFT(); SelectedWindowIndices indices = parentRef.GetSelectedWindowIndices(); if (applyToWindow) { if (!indices.Exists()) { MessageBox.Show("There is no window selected!"); return; } Processing.AddGain(stft, dbGain, indices, dB: true); } else { Processing.AddGain(stft, dbGain, dB: true); } }
public void ApplyWhiteNoiseFilter(double threshold, bool applyToWindow = false) { FFTs stft = parentRef.GetSTFT(); SelectedWindowIndices indices = parentRef.GetSelectedWindowIndices(); if (applyToWindow) { if (!indices.Exists()) { MessageBox.Show("There is no window selected!"); return; } Filters.WhiteNoiseFilter(stft, threshold, indices); } else { Filters.WhiteNoiseFilter(stft, threshold); } }