Search code examples
c#.netaudiomp3naudio

Using NAudio for .NET how do I remove the silence wave at the end of mp3 file?


I am working on a C# WPF application that groups a group of words (from about 17,000 words) together and generates a playlist matching mp3 files (each mp3 file being a word).

Currently each mp3 file has a random silence between 1 second to 30 seconds at the end of its wave.

I want to be able to programmatically remove the silence wave from the end of the file.

Using NAudio for .NET how do I remove the silence wave from the end of mp3 file?


Solution

  • I accomplished Using SoX

    Doc for SoX Silence: http://digitalcardboard.com/blog/2009/08/25/the-sox-of-silence/

    Stackoverflow Help Reference for SoX Silence end of file: https://stackoverflow.com/a/11834671/677607

    Command Line execution using C#: https://stackoverflow.com/a/1469790/677607