Learn through the super-clean Baeldung Pro experience:
>> Membership and Baeldung Pro.
No ads, dark-mode and 6 months free of IntelliJ Idea Ultimate to start with.
Last updated: June 13, 2025
In this article, we’ll learn how to split an MP3 track in Linux losslessly. We’ll use FFmpeg to extract a portion of the audio based on timestamps. Next, we’ll cover the SoX utility for the same purpose.
Finally, we’ll cover the powerful mp3splt utility to split an MP3 track into many individual tracks.
FFmpeg is a powerful tool that converts and manipulates multimedia files. It allows us to cut or split MP3 files without re-encoding the audio. Thereby, the audio quality remains intact without degradation.
In addition, the cutting process is almost instant because no re-encoding is involved. In the next section, we’ll use several ways to cut MP3 files with FFmpeg.
We can split the file by specifying the start and end timestamps:
$ ffmpeg -i demo.mp3 -vn -acodec copy -ss 00:00:10 -to 00:00:30 demo-cut.mp3
Let’s break this down:
Notably, the duration for the output file will be 20 seconds. Besides, the timestamp is in the hh:mm:ss format. We can also specify the milliseconds like hh:mm:ss.mmm.
We can also specify the duration of the cut from the start timestamp:
$ ffmpeg -i demo.mp3 -vn -acodec copy -ss 00:00:00 -t 00:01:50 demo-cut.mp3
The -t option specifies the duration. In this case, the cut will be a minute and 50 seconds long. In addition, if the cut duration is higher than the audio duration, then FFmpeg will cut the audio till the end of the track.
By omitting the ending timestamp and duration, FFmpeg will effectively cut the audio till the end:
$ ffmpeg -i demo.mp3 -vn -acodec copy -to 00:01:00 demo-cut.mp3
As we can see, it’s a relatively straightforward approach to specifying a long, arbitrary duration.
In contrast, we can also omit the start time:
$ ffmpeg -i demo.mp3 -vn -acodec copy -to 00:01:00 demo-cut.mp3
Omitting the start time implies the timestamp to be 00:00:00.
SoX is an audio processing utility that can manipulate and convert audio files. Besides, it’s also capable of trimming audio files.
Let’s create a 20 seconds audio out of demo.mp3:
$ sox demo.mp3 demo-cut.mp3 trim 10 20
Let’s examine closely:
It efficiently cuts the audio without re-encoding. Therefore, we get a lossless cut of the source. Moreover, we can also apply audio effects like adding a volume boost to the cut track:
$ sox demo.mp3 demo-cut.mp3 vol 2.0 trim 10 20
In the command, vol 2.0 will increase the audio volume by a factor of 2.
mp3splt is a special utility that splits MP3 audio into multiple tracks. It has a lot of options for splitting MP3 files.
mp3splt is magical. Not only can it trim the audio, but it can also automate the cutting process. It means that if we have a long MP3 file, we can specify criteria for splitting the file into many individual tracks.
For instance, we can specify a silence threshold to split an MP3 file:
$ mp3splt -o @f_@n -f -p silence -t 0.5 -c demo.mp3
Let’s dig into this:
The tracks will be named demo_n.mp3, which is the number of tracks we can quickly burn to a CD. Furthermore, the process does not affect the quality of the tracks because the tracks aren’t re-encoded.
We can split down an MP3 into two equal parts that will have the same duration:
$ mp3splt -o @n -f -S +2 demo.mp3
-S +2 effectively splits the file into two equal parts in terms of duration: 1.mp3 and 2.mp3. Let’s verify this:
$ mediainfo --Inform="General;%FileName%.%FileExtension%: %Duration/String2%\n" 1.mp3 2.mp3
1.mp3: 1 min 6 s
2.mp3: 1 min 6 s
mp3splt is also capable of splitting audio based on given timestamps:
$ mp3splt -o demo-cut 00.30 00.50 demo.mp3
We gave the timestamps in the form of mm.ss for the cut. Therefore, the resulting audio will be 20 seconds long.
In this article, we explored the various possibilities to cut audio files. We used FFmpeg as well as SoX to trim an MP3 track. Lastly, we covered mp3splt to create many tracks from an MP3 file using specific criteria.