I need to decode an MP3 file with Python. What is a good library which can do that?
I looked at PyMedia but the project seems dead and it didn't worked on MacOSX. Then I found out about pyffmpeg but I didn't got it working on MacOSX so far.
Any suggestion?
I did try an easy_install
of PyMedia on OS X / Fink, and it did not work because it could not find the source. This module does look quite dead…
One way of decoding MP3 is to call ffmpeg
without going through pyffmpeg, but by calling ffmpeg using the standard subprocess module instead.
You really need an external library. It'd be very difficult to do in Python with any sort of speed - see How to convert MP3 to WAV in Python for some discussion.
How about python-mad? MAD being the 'mpeg audio decoder'; there's a python library. It'd give you the audio data. Never used it myself...
I decided to code this myself based on subprocess and ffmpeg.
Some code can be found here: https://github.com/albertz/learn-midi/blob/master/decode.py
Please try https://github.com/sampsyo/audioread
It's fast, installs from pypi and works well
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With