Exemplo n.º 1
0
        private void View_ExportWAVClicked(object sender, EventArgs e)
        {
            AudioWave wave = _view.SelectedWave;

            if (wave != null)
            {
                var sfd = new SaveFileDialog
                {
                    AddExtension     = true,
                    OverwritePrompt  = true,
                    Title            = "Export Selected WAV",
                    Filter           = "WAV Audio File (*.wav)|*.wav",
                    InitialDirectory = _lastSaveDirectory,
                    FileName         = wave + ".wav"
                };

                if (sfd.ShowDialog() == DialogResult.OK)
                {
                    using (var f = new FileStream(sfd.FileName, FileMode.Create, FileAccess.Write))
                    {
                        WaveExport.Export(_file, wave, f);
                    }

                    _lastSaveDirectory = new FileInfo(sfd.FileName).Directory.FullName;

                    MessageBox.Show("Audio exported.", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Exemplo n.º 2
0
        public void Initialize(AudioFile file, AudioWave wave)
        {
            _file = file;
            _wave = wave;

            _format = new WaveFormat(_wave.SamplesPerSecond, 16, 1);

            _lastBlock = -1;
            _looped    = false;

            _state          = new DviAdpcmDecoder.AdpcmState();
            _leftOverBuffer = null;
        }
Exemplo n.º 3
0
        public void Initialize(AudioFile file, AudioWave wave)
        {
            _file = file;
            _wave = wave;

            _format = new WaveFormat(_wave.SamplesPerSecond, 16, 1);

            _lastBlock = -1;
            _looped = false;

            _state = new DviAdpcmDecoder.AdpcmState();
            _leftOverBuffer = null;
        }
Exemplo n.º 4
0
        public void AddWave(AudioWave audioWave)
        {
            ListViewItem lvi = new ListViewItem(audioWave.ToString());

            lvi.Name = audioWave.ToString();
            lvi.Tag  = audioWave;

            TimeSpan playTime = audioWave.Length;

            ListViewItem.ListViewSubItem lvisub = new ListViewItem.ListViewSubItem();
            lvisub.Tag  = playTime;
            lvisub.Text = playTime.ToString();
            lvi.SubItems.Add(lvisub);

            lvisub      = new ListViewItem.ListViewSubItem();
            lvisub.Tag  = audioWave.SamplesPerSecond;
            lvisub.Text = audioWave.SamplesPerSecond + " Hz";
            lvi.SubItems.Add(lvisub);

            listAudioBlocks.Items.Add(lvi);
        }
Exemplo n.º 5
0
        public void AddWave(AudioWave audioWave)
        {
            ListViewItem lvi = new ListViewItem(audioWave.ToString());
            lvi.Name = audioWave.ToString();
            lvi.Tag = audioWave;

            TimeSpan playTime = audioWave.Length;
            ListViewItem.ListViewSubItem lvisub = new ListViewItem.ListViewSubItem();
            lvisub.Tag = playTime;
            lvisub.Text = playTime.ToString();
            lvi.SubItems.Add(lvisub);

            lvisub = new ListViewItem.ListViewSubItem();
            lvisub.Tag = audioWave.SamplesPerSecond;
            lvisub.Text = audioWave.SamplesPerSecond + " Hz";
            lvi.SubItems.Add(lvisub);

            listAudioBlocks.Items.Add(lvi);
        }