I rip all my old CDs as MP3s now.Â I used to rip as Ogg Vorbis, both for the higher quality, and because Ogg isn’t a patent-encumbered format, but there are just too many music applications (both software and embedded systems, such as the Netgear MP-101 wireless music streamers I picked up cheap to scatter around the house) that don’t understand Ogg, so I gave up.Â MP3 it is.
Now, I’m trying to put together a simple script to merge an MP3 playlist into a single MP3.Â Sox should do the trick … but it doesn’t come with built-in MP3 support (for obvious reasons).Â Here’s what I did to build MP3 support into Sox — many thanks to a good post by Michael Walma on the Ubuntu Forums.
First, make sure you have what you’ll need.Â LibLAME is the library for encoding MP3s — your specific version may vary from what’s below (use Synaptic Pkg Mgr to check what’s available with a search on “lame” if in doubt).Â Be sure that you have universe, multiverse and restricted enabled in your package sources (
/etc/apt/sources.list), as anything MP3-related is going to come from the non-standard locations.
sudo apt-get install sox liblame0 liblame-dev
sudo apt-get build-dep sox
Switch to where you’re going to build it (e.g.,
sudo apt-get source sox
Unpack the source and switch to the source directory (your version is likely to vary):
sudo dpkg-source -x sox_14.0.0-5.dsc
Now you need to enable LAME support:
sudo vi debian/rules
And comment out the line that reads:
DEB_CONFIGURE_EXTRA_FLAGS := --disable-lame
sudo dpkg-buildpackage -b
Back up to the parent directory (
cd ..) and install the newly-built packages.Â For me, only new Sox packages were in the directory, so I just swept them up together.Â Otherwise, you’d need to do them one by one, or with a filter such as
sudo dpkg -i *.deb
And, now, you should be able to confirm that you have support with: