tuffy / python-audio-tools

A collection of audio handling programs which work from the command line.
http://audiotools.sourceforge.net
GNU General Public License v2.0
249 stars 58 forks source link

No MP3 support in OS X 10.9 #35

Open intuited opened 10 years ago

intuited commented 10 years ago

I've installed lame using brew install lame --universal. I've acquired the python-audio-tools source via git, and have checked out version 2.21. Running make install after doing make distclean (and after lame installation) doesn't produce any error or warning messages. Output from make probe indicates that an mp3 library is present. However, mp3 shows up in red when I do audiotools-config.

which lame gives /usr/local/bin/lame; lame's library is at /usr/local/lib/libmp3lame.dylib.

I'm similarly unable to use other formats like ogg and mp2 despite having also installed their packages. However, they are not listed as present by make probe.

tuffy commented 10 years ago

Have you also installed libmpg123? Lame is needed for encoding, but mp3 and mp2 won't be available unless they have both the encoder and decoder (in this case mpg123 is used to decode both mp3 and mp2). The same is true for vorbisfile, which is needed for ogg decoding.

It should be possible to split formats into those that are "write capable" and "read capable" such that one might be able to encode mp3 with only lame but not decode it, but I haven't gotten around to that yet.

intuited commented 10 years ago

Yep, libmpg123 was also installed via brew install mpg123 before compilation. It's located at /usr/local/lib/libmpg123.dylib.

Though actually, I'm realizing that libmpg123.dylib is not a universal binary (as per running file on it). That's possibly the issue. Is there a way to build python-audio-tools so that it is compatible with 64-bit libraries? brew doesn't provide a --universal option when installing the mpg123 package.

PS I noticed an error message when building python-audio-tools earlier when I had the non- --universal version of lame installed, but I don't get that message currently at all.

intuited commented 10 years ago

Tried building on an ubuntu VM. It looks like the problem is definitely that 32-bit libraries are needed.

Steps:

VM OS is an updated Ubuntu 14.04.1 LTS.

There were no error or warning messages displayed during the build either time.

tuffy commented 10 years ago

That would explain why I hadn't been able to duplicate the problem under OS X. I've been compiling mpg123 from source with XCode which generates 32-bit and 64-bit dylib files for libmpg133 and the linker had been skipping the 32-bit one. I'll have to see if there's some way to get distutils to detect that condition and put up an appropriate warning at build-time.

intuited commented 10 years ago

I'm still confused as to why I can't continue with just a 64-bit libmpg123.dylib. I've verified that python is running as 64-bit; why does it need a 32-bit library to link to? Does this mean that I'll have to build libmpg123.dylib from source, as well as the various other libraries for other formats? Is it normal for this to happen under linux also? I don't recall having this problem with my old 64-bit linux machine.

intuited commented 10 years ago

Still wondering what I should do to get this running. I tried compiling mpg123 myself but there were errors in the compilation that I don't have time to look at.