Manipulate MP3 Software: Disconnecting Some Parts?

I am trying to write a batch process that can take an MP3 file and disable some parts of it, ideally in Python or Java.

Take this example: given a 2 minute MP3, I want to turn off the time between 1:20 and 1:30. When saving back to a file, the rest of the MP3 will play normally - only that part will be silent.

Any tips for setting up this method that are easy to automate / run on the command line will be fantastic!

+3
source share
4 answers

SoX is a multi-platform audio editing tool, and I have used it in the past. Additional information at http://sox.sourceforge.net/

I don’t think you can disable the section of an MP3 file with a single command. You can split the file into 3 parts, disable the middle part, and then stitch them again.

Hope that helps

+1
source

One (somehow pretentious) idea: to record silent (quiet) mp3 in the bitrate, which is your mp3. Then copy all the frames from the original mp3 to the point where you want your silence to begin. Then copy as many muted frames from your silence file as possible. Then copy the rest of the source file.

You will have muted audio without re-encoding the file!

+1

Audacity (available for Windows, Mac, Linux) has a plugin (currently only for Windows) that allows you to create scripts. The target language is Perl, but perhaps Python will work.

There is also a built-in XLisp interpreter called Nyquist.

0
source

Or use Xuggler to decode the MP3 file, mute the sound you care about, and then transcode.

0
source

Source: https://habr.com/ru/post/1714685/