Search code examples
shellsplitmp3

Trim the first 11 seconds from an mp3 file


I'm trying to write a script that takes off the first 11 seconds from more than 100 mp3 files.

Can I use the "split" command to do it? Or is there any Mac CLI program that I can use?


Solution

  • Try ffmpeg.

    ffmpeg -i infile.mp3 -ss 11 outfile.mp3
    

    In case your ffmpeg does not support mp3 encoding, try below:

    ffmpeg -i infile.mp3 -ss 11 /tmp/outfile.wav
    lame /tmp/outfile.wav outfile.mp3
    

    You will need to install these packages though :)