Introduction

Ever had an MP3 file that is just too long to listen to in one sitting? Normal MP3 playing software allows you to pause playback and continue later, but some portable media players only have track-skip buttons and don't allow the listener to search within a track. If you are listening to multiple short audio tracks, this isn't a problem but if the MP3 file is longer, it can be a pain. A good example is an episode of LUG Radio which often runs over an hour, but is a single Ogg or MP3 track.

mp3splt is a piece of software that is designed to split MP3, Ogg and Vorbis tracks up into multiple chunks. There is an mp3splt package in Debian Sarge and Ubuntu Hoary. This guide covers compiling and installing mp3splt from source on a Debian Unstable system. (mp3splt appears to be in Debian Unstable now --DavidRamsden).

Compiling from source

  1. Download the source tarball from http://mp3splt.sourceforge.net/. The version used in this document is 2.1.

  2. Untar the source using

$ tar zxvf mp3splt-2.1-src.tar.gz
  1. Change to the mp3splt-2.1 directory.

  2. Install the development packages for libmad, libogg and libvorbis and all their dependencies as root:

# apt-get install libmad0-dev libogg-dev libvorbis-dev
  1. Run the configure script:

$ ./configure

The script will show an error if any of the libraries or dependencies are missing. If all goes well you should see the configure script end like this:

checking for mad_frame_decode in -lmad... yes
checking for fseeko... yes
checking for Ogg... yes
checking for Vorbis... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating config.h
config.status: executing depfiles commands
  1. Compile the software with the command make.

  2. Install the program as root with the command make install.

Testing

  1. In order to test the software you will need a long mp3, ogg or vorbis file. The latest episode of LUG Radio should do the trick.

  2. Try splitting the track lugradio-s2-ep1-201004-high.mp3 up into 5 minute chunks using the command:

$ mp3splt -t 5.00 lugradio-s2-ep1-201004-high.mp3

You should see output something like this:

Mp3Splt 2.1 (2004/Sep/28) by Matteo Trotta <matteo.trotta@lib.unimib.it>
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
Warning: found Xing or Info header, mp3 may be VBR. Switching to Frame mode...
MPEG 2 Layer 3 - 22050 Hz - Mono - FRAME MODE - Total time: 62m.34s
Splitting lugradio-s2-ep1-201004-high_000.00_005.00.mp3... OK
Splitting lugradio-s2-ep1-201004-high_005.00_010.00.mp3... OK
Splitting lugradio-s2-ep1-201004-high_010.00_015.00.mp3... OK
Splitting lugradio-s2-ep1-201004-high_015.00_020.00.mp3... OK
Splitting lugradio-s2-ep1-201004-high_020.00_025.00.mp3... OK
Splitting lugradio-s2-ep1-201004-high_025.00_030.00.mp3... OK
Splitting lugradio-s2-ep1-201004-high_030.00_035.00.mp3... OK
Splitting lugradio-s2-ep1-201004-high_035.00_040.00.mp3... OK
Splitting lugradio-s2-ep1-201004-high_040.00_045.00.mp3... OK
Splitting lugradio-s2-ep1-201004-high_045.00_050.00.mp3... OK
Splitting lugradio-s2-ep1-201004-high_050.00_055.00.mp3... OK
Splitting lugradio-s2-ep1-201004-high_055.00_060.00.mp3... OK
Splitting lugradio-s2-ep1-201004-high_060.00_065.00.mp3... OK (EOF)
Processed 143724 frames - Sync errors: 0

The file name has been adjusted to include the time span that the individual file covers. These files should still play in order when sorted by standard players. You might want to rename the original file before running mp3splt, as filenames can easily become quite unwieldy.


This page originally by TonyWhitmore

LinuxHints/CompilingMp3splt (last edited 2006-04-27 01:14:27 by 81)