pymad is a Python module that allows Python programs to use the MPEG Audio Decoder library. pymad provides a high-level API, similar to the pyogg module, which makes reading PCM data from MPEG audio streams a piece of cake.
Using pymad is as easy as:
import mad, ao, sys
mf = mad.MadFile(sys.argv)
dev = ao.AudioDevice('oss', rate=mf.samplerate())
buf = mf.read()
if buf is None:
dev.play(buf, len(buf))pymad uses the Python distutils tool. To build and install pymad, install python and libmad development files, and then:
# python config_unix.py --prefix /usr/local
# python setup.py build
# python setup.py install --prefix /usr/localRemember to make sure /usr/local/python/site-packages/ is in your Python search path.
These details are provided for information only. No information here is legal advice and should not be used as such.