Mp3 add silence beginning or end, Linux command line

To add silence at the beginning or at the end of an mp3 file, use “sox” with “pad”:

sox original.mp3 new.mp3 pad 2.5 0

This adds 2.5s of blank space at the beginning of the mp3 file, 0s at the end

Automate this for a batch of file, put results files in ./output folder:

for i in ./*.mp3; do sox $i output/$i pad 2.5 0; done

To remove part of the track, use “trim” “when to start” “when to end”. Example to keep only audio from 2.5s to 20s:

sox original.mp3 trimmedpart.mp3 trimmed 2.5 20

If you want to remove only some seconds at start, just put the second number higher than the actual duration of the track.

Make sure you installed libsox-fmt-mp3

This entry was posted in Uncategorized. Bookmark the permalink.