Search code examples
javapythonaudiomp3

Manipulate MP3 programmatically: Muting certain parts?


I'm trying to write a batch process that can take an MP3 file and mute certain parts of it, ideally in Python or Java.

Take this example: Given a 2 minute MP3, I want to mute the time between 1:20 and 1:30. When saved back to a file, the rest of the MP3 will play normally -- only that portion will be silent.

Any advice for setting this up in a way that's easy to automate/run on the command line would be fantastic!


Solution

  • SoX is a multi-platform sound editing tool and I've used it a lot in the past. More info at http://sox.sourceforge.net/

    I don't think you can mute a section of an MP3 file with a single command though. You could split the file into 3 parts, mute the middle part, then stitch them together again.

    Hope that helps