Building sox with mp3 support (UPDATED). Works on OSX 10.9 Mavericks.

This is a revised set of instructions to get sox working on OSX with mp3 support. I recently went through the process that I explained in a previous post on a fresh OSX 10.9 Mavericks system. It was quite straightforward to get sox+mp3 working based on those instructions. I realized, though, that some small changes were needed to make it work.

1. Download sox, and the lame and libmad tarballs: sox-14.4.1, lame-3.99.5, libmad-0.15.1b. Build all three from source forcing a 32-bit build (libmad is a bit old):

2. Build libmad using the following configure flags:

./configure CFLAGS="-m32 -arch i386" LDFLAGS="-arch i386" --enable-shared --disable-static
sudo make
sudo make install

3. Build lame using the following configure flags:

./configure CFLAGS="-m32 -arch i386" LDFLAGS="-arch i386" --enable-shared --disable-static
sudo make
sudo make install

4. Build sox with libmad and lame support using the following options:

./configure CFLAGS="-m32 -arch i386" LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/path/to/your/libmad-0.15.1b -I/path/to/your/lame-3.99.5/include" --with-mad --with-lame
sudo make -s
sudo make install

NOTE: You will need to substitute the “/path/to/your” bit with the real folders where the libmad and lame sources are located on your hard disk (probably in your Downloads/ folder if you didn’t move them).

After running the ./configure line in step #4 you should check the list of optional file formats to make sure that everything went well, i.e. mp3 is now active (“mp3=yes”):

Disclaimer: this may or may not work for you. On my computer the previous steps produce a fully functional sox binary with mp3 encoding/decoding capabilities. Good luck and thanks for your feedback.

17 thoughts on “Building sox with mp3 support (UPDATED). Works on OSX 10.9 Mavericks.

  1. Pingback: Building sox with mp3 support on OSX |

  2. gigicarlo

    configure: error: libid3tag was not found
    *** You must first install libid3tag before you can build this package.
    *** If libid3tag is already installed, you may need to use the LDFLAGS
    *** environment variable to specify its installed location, e.g. -L.

    maybe it needs an update ???


    1. admin Post author

      Dear gigicarlo,

      thanks for your report.

      Yesterday I installed sox following these instruction on 10.8 and initially I had some trouble too. After some testing, I realised that the system disk on that computer had a space in its name (“Work 1”), which messed up the installation of the libraries. Once fixed (“hd1”), everything worked perfectly well. May be something similar is causing you trouble?

      For the record, I also recently noticed that in Mavericks the command line tools are an optional package which you have to install manually for gcc to work, but I am sure you already know this 😉

      If this doesn’t do it for you, could you provide some more more details? I would suggest to run the commands step by step and double check for errors after running each line.

      Thanks again for stopping by and best regards.

  3. Pingback: Stuart Langridge: Making a static build of sox | Hi-tech news

  4. Karim

    Thanks for that ! But one thing, the command, especially ./configure … etc doesn’t show well on this page, I had view the html source to get the correct full command, otherwise it is truncated. You should enable scrolling to your code html tags.

    1. admin Post author

      Glad you found this post useful and thanks for your feedback 🙂 I recently also had the opportunity to try this on Yosemite, and can confirm that it still works without problems.

      Concerning the display of the page, what browser are you using? With Safari I have no problem scrolling through the longer lines of code..


  5. Juan

    Everything went well until last step, when I get:
    -bash: –with-mad: command not found


    I’m running Sierra.


Leave a Reply

Your email address will not be published. Required fields are marked *