private void btnExtractWave_Click(object sender, System.EventArgs e)
        {
            txtReportSound.Text = "Extracting " + txtAviFileName.Text + " to sound.wav...\r\n";
            AviManager aviManager = new AviManager(txtAviFileName.Text, true);

            try {
                AudioStream audioStream = aviManager.GetWaveStream();
                audioStream.ExportStream(@"..\..\testdata\sound.wav");
                aviManager.Close();
                txtReportSound.Text += "...finished.";
            } catch (Exception ex) {
                MessageBox.Show(this, "The file does not contain a wave audio stream, or it cannot be opened.\r\n" + ex.ToString(), "No Stream Found");
            }
        }
Beispiel #2
0
        /// <summary>
        /// extractig sound from video and savgion as a file
        /// </summary>
        /// <param name="testAviFile"></param>
        public static void ExtractSound(string testAviFile)
        {
            AviManager aviManager = new AviManager(testAviFile, true);

            try
            {
                AudioStream audioStream = aviManager.GetWaveStream();
                audioStream.ExportStream(@"sound.wav");
                aviManager.Close();
                Program.LogInfo("...finished.");
            }
            catch (Exception ex)
            {
                Program.LogError("The file does not contain a wave audio stream, or it cannot be opened.\r\n" + ex.ToString());
            }
        }