Esempio n. 1
0
        private void LoadFile(object o)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Title      = "Browse WAV Files";
            openFileDialog.DefaultExt = "wav";
            openFileDialog.Filter     = "WAV files (*.wav)|*.wav";

            if (openFileDialog.ShowDialog() == true)
            {
                WavData data = WavReader.ReadData(openFileDialog.FileName);
                this.Channel    = data.Samples;
                this.FileName   = openFileDialog.FileName;
                this.SampleRate = data.FormatChunk.SampleRate;
                List <DataPoint> signal = new List <DataPoint>();
                for (int i = 0; i < this.Channel.Length; i++)
                {
                    signal.Add(new DataPoint(i, this.Channel[i]));
                }
                this.Signal = signal;
                this.AutocorrelationFreq = null;
                this.FourierFreq         = null;
                this.AutocorrelationData = null;
                Notify.Info("WAV file loaded sucessfully!");
            }
        }
Esempio n. 2
0
        private void LoadFile(object o)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Title      = "Browse WAV Files";
            openFileDialog.DefaultExt = "wav";
            openFileDialog.Filter     = "WAV files (*.wav)|*.wav";

            if (openFileDialog.ShowDialog() == true)
            {
                this.SignalData = WavReader.ReadData(openFileDialog.FileName);
                this.FileName   = openFileDialog.FileName;
                Notify.Info("WAV file loaded sucessfully!");
            }
        }
        private void Load()
        {
            OpenFileDialog openFileDialog = new OpenFileDialog
            {
                Filter           = "Sound files (*.wav)|*.wav",
                RestoreDirectory = true,
                Multiselect      = true
            };

            if (openFileDialog.ShowDialog() == true)
            {
                for (int i = 0; i < openFileDialog.FileNames.Length; i++)
                {
                    var data = WavReader.ReadData(openFileDialog.FileNames[i]);
                    SoundPlayerViewModel.AddSound(openFileDialog.SafeFileNames[i], data);
                }
            }
        }