Why isn't sox able to convert to mp3?

13

1

I installed Sox, i installed lame-398, but sox is not able to convert any file to mp3. It fails with the messages:

./../sox FAIL util: Unable to load LAME encoder library (libmp3lame).
./../sox FAIL formats: can't open output file `funktech.mp3':  

How can i check if lame has been installed correct? How can i get sox to find the mp3Library?

edit: I did not install sox at all, it works without installing directly from the commandline. Lame was installed by following the instructions on their site:

./configure
make
make install

which results in the following files being found in /usr/local/lib/ : libmp3lame.dylib, libmp3lame.la, libmp3lame.a Maybe symlinking libmp3lame.la, which is marked as executable, to /usr/bin would help?

marue

Posted 2011-02-17T10:16:20.947

Reputation: 131

1You should consider telling us how you installed these programs. – Daniel Beck – 2011-02-17T13:40:36.040

2I have the same issue. Although the sox OS X readme states to only place libmp3lame.dylib in /usr/lib or /usr/local/lib, the latter of which is used by Homebrew (and I filled the former with symlinks), it doesn't work with the download version of sox. – Daniel Beck – 2011-02-17T15:40:11.180

Answers

13

Brew didn't pull in lame when I installed sox. After a bunch of searching and trial and error, I figured out:

$ brew install lame
$ brew reinstall sox --with-lame # or "brew install sox" if you don't already have it installed

Now sox can write mp3s.

Dan Benamy

Posted 2011-02-17T10:16:20.947

Reputation: 271

The --with-lame flag did the trick for me. Without it sox could play MP3 files but could not encode them. Thanks @glasz! – Adam Wildavsky – 2014-08-22T22:56:49.300

4

now there's a --with-lame flag for sox.

– glasz – 2013-09-20T23:08:17.363

6

I had to do this:

brew reinstall sox --with-lame

DavidH

Posted 2011-02-17T10:16:20.947

Reputation: 173

3

I installed sox using Homebrew. It automatically downloaded the lame dependency and works like a charm.

$ brew install sox

I tried it using:

$ sox somepodcast.mp3  -C 12 test.mp3

test.mp3 sounds worse than somepodcast.mp3. Mission accomplished.

Daniel Beck

Posted 2011-02-17T10:16:20.947

Reputation: 98 421

1I don't like this as an answer to this specific issue, as it depends on a tool i don't use. And it just tells me that i could have done things another way, which doesn't help me to understand whats going on. But i like Homebrew, which i didn't know until now, thank you for that. – marue – 2011-02-17T15:25:37.213

2@marue It's the best I could do without you having explained how you installed it. Plus, it works. – Daniel Beck – 2011-02-17T15:29:44.900

Of course, i didn't want to offend you in any way. Thank you for your efforts. – marue – 2011-02-17T18:54:23.940