Extract wav file from video file

后端 未结 3 1358
既然无缘
既然无缘 2020-12-20 21:53

I am developing an application in which I need to extract the audio from a video. The audio needs to be extracted in .wav format but I do not have a problem with the video f

相关标签:
3条回答
  • 2020-12-20 22:19

    Here is a link on how to extract audio using GraphEdit, GraphEdit is an front end UI for the DirectShow API so everything it can do you can do with API.
    You can use the DirectShow.NET liberty which wraps the DirectShow API for the managed world.

    0 讨论(0)
  • 2020-12-20 22:22

    If you want to do this with C#, take a look at NAudio library. It can analyze the audio format (like FFMpeg) and also provide the audio stream. Here's one example.

    Snippet from the sample:

    using NAudio.Wave;
    using System.IO;
    
    ...
    
    // contentAsByteArray consists of video bytes
    MemoryStream contentAsMemoryStream = new MemoryStream(contentAsByteArray);
    
    using (WaveStream pcmStream =
        WaveFormatConversionStream.CreatePcmStream(
            new StreamMediaFoundationReader(contentAsMemoryStream)))
    {
        WaveStream blockAlignReductionStream = new BlockAlignReductionStream(pcmStream);
    
        // Do something with the wave stream
    }
    
    0 讨论(0)
  • 2020-12-20 22:31

    Probably easiest to use ffmpeg for this kinda thing...

    0 讨论(0)
提交回复
热议问题