Albert
Albert

Reputation: 68110

Python: decode mp3

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?

Upvotes: 7

Views: 5280

Answers (4)

Yuri Baburov
Yuri Baburov

Reputation: 722

Please try https://github.com/sampsyo/audioread

It's fast, installs from pypi and works well

Upvotes: 1

Albert
Albert

Reputation: 68110

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

Upvotes: 1

Robert
Robert

Reputation: 6540

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...

Upvotes: 1

Eric O. Lebigot
Eric O. Lebigot

Reputation: 94475

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.

Upvotes: 1

Related Questions