Nav links

Sunday, 10 December 2006

mp3 splitting

If you have an mp3 player that doesn't remember its position within a track when it's turned off, and has no fast-forward or rewind, then listening to long audio books on short commutes is impossible (because you can't resume midway through a track on a later journey). One workaround is to split your mp3 files into shorter parts, and for this I recommend the delightful free open source, GPL-licensed mpgedit (which runs on Windows, Mac and Linux).

It works on CBR and VBR files, and does the splitting without reencoding.

I also had a look at the free mp3DirectCut, which did a similar job through a GUI. For my needs, though, I wanted a simple command-line operation, for which mpgedit was better suited.

Its use is simple. For example, to split a 36 minute audio book into two 18 minute halves:

mpgedit -e -18:00 -e 18:00 -f audioBook.mp3

Here, each -e parameter indicates a separate output file, the first containing everything up to the 18 minute mark, the second everything after 18 minutes. Since 18 minutes is my commute time, I set up a batch file so that I only need to pass in the filename to split.

For files that are longer than 36 minutes, just repeat the split. For example, with a 38 minute file after one split, you end up with:
  • audioBook_1.mp3 (18 minutes) and
  • audioBook_2.mp3 (30 minutes)


After a second split, passing in audioBook_2.mp3 as the file to be split, you then have:
  • audioBook_1.mp3 (18 minutes)
  • audioBook_2_1.mp3 (18 minutes)
  • audioBook_2_2.mp3 (12 minutes)


Quite elegant, really.