{"id":19,"date":"2009-03-08T13:33:23","date_gmt":"2009-03-08T12:33:23","guid":{"rendered":"http:\/\/eggblog.invertedegg.com\/?p=19"},"modified":"2009-03-08T13:33:23","modified_gmt":"2009-03-08T12:33:23","slug":"building-mp3-support-into-sox","status":"publish","type":"post","link":"http:\/\/eggblog.invertedegg.com\/?p=19","title":{"rendered":"Building MP3 support into Sox"},"content":{"rendered":"<p>I rip all my old CDs as MP3s now.\u00c2\u00a0 I used to rip as Ogg Vorbis, both for the higher quality, and because Ogg isn&#8217;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&#8217;t understand Ogg, so I gave up.\u00c2\u00a0 MP3 it is.<\/p>\n<p>Now, I&#8217;m trying to put together a simple script to merge an MP3 playlist into a single MP3.\u00c2\u00a0 Sox should do the trick &#8230; but it doesn&#8217;t come with built-in MP3 support (for obvious reasons).\u00c2\u00a0 Here&#8217;s what I did to build MP3 support into Sox &#8212; many thanks to a <a title=\"How to compile SOX with LAME support\" href=\"http:\/\/ubuntuforums.org\/showthread.php?t=17272\" target=\"_blank\">good post by Michael Walma on the Ubuntu Forums<\/a>.<\/p>\n<p>First, make sure you have what you&#8217;ll need.\u00c2\u00a0 LibLAME is the library for encoding MP3s &#8212; your specific version may vary from what&#8217;s below (use Synaptic Pkg Mgr to check what&#8217;s available with a search on &#8220;lame&#8221; if in doubt).\u00c2\u00a0 Be sure that you have universe, multiverse and restricted enabled in your package sources (<code>\/etc\/apt\/sources.list<\/code>), as anything MP3-related is going to come from the non-standard locations.<\/p>\n<pre>sudo apt-get install sox liblame0 liblame-dev<\/pre>\n<pre>sudo apt-get build-dep sox<\/pre>\n<p>Switch to where you&#8217;re going to build it (e.g., <code>cd \/usr\/local\/src<\/code>).<\/p>\n<pre>sudo apt-get source sox<\/pre>\n<p>Unpack the source and switch to the source directory (your version is likely to vary):<\/p>\n<pre>sudo dpkg-source -x sox_14.0.0-5.dsc<\/pre>\n<pre>cd sox-14.0.0<\/pre>\n<p>Now you need to enable LAME support:<\/p>\n<pre>sudo vi debian\/rules<\/pre>\n<p>And comment out the line that reads:<\/p>\n<pre>DEB_CONFIGURE_EXTRA_FLAGS := --disable-lame<\/pre>\n<p>Build it:<\/p>\n<pre>sudo dpkg-buildpackage -b<\/pre>\n<p>Back up to the parent directory (<code>cd ..<\/code>) and install the newly-built packages.\u00c2\u00a0 For me, only new Sox packages were in the directory, so I just swept them up together.\u00c2\u00a0 Otherwise, you&#8217;d need to do them one by one, or with a filter such as <code>*sox*.deb<\/code>:<\/p>\n<pre>sudo dpkg -i *.deb<\/pre>\n<p>And, now, you should be able to confirm that you have support with:<\/p>\n<pre>sox -h<\/pre>\n<p>Success!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I rip all my old CDs as MP3s now.\u00c2\u00a0 I used to rip as Ogg Vorbis, both for the higher quality, and because Ogg isn&#8217;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 &hellip; <a href=\"http:\/\/eggblog.invertedegg.com\/?p=19\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Building MP3 support into Sox&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"http:\/\/eggblog.invertedegg.com\/index.php?rest_route=\/wp\/v2\/posts\/19"}],"collection":[{"href":"http:\/\/eggblog.invertedegg.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/eggblog.invertedegg.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/eggblog.invertedegg.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/eggblog.invertedegg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19"}],"version-history":[{"count":3,"href":"http:\/\/eggblog.invertedegg.com\/index.php?rest_route=\/wp\/v2\/posts\/19\/revisions"}],"predecessor-version":[{"id":22,"href":"http:\/\/eggblog.invertedegg.com\/index.php?rest_route=\/wp\/v2\/posts\/19\/revisions\/22"}],"wp:attachment":[{"href":"http:\/\/eggblog.invertedegg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/eggblog.invertedegg.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/eggblog.invertedegg.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}