Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }