The Asterisk Solution
This is a message I sent out to the Asterisk community after having a chat with representatives of which at the LinuxTag 2008, archived for future reference.
As current maintainer of the mpg123 project (yes - it _is_ active again; officially since two years now), I from time to time get requests from asterisk users on how to set up mp3 decoding for music-on-hold (I guess) with mpg123. For several years, there prevailed a really unfortunate situation in that respect:
- The official mpg123 was dead, the old version 0.59r in debian worked, but was confined to the non-free section
- The slightly fresher pre0.59s (in gentoo, for example) had trouble with the downsampling to 8000Hz due to the MMX accelerated decoder.
- Then there was/is the sort-of replacement mpg321 masquerading as mpg123 in many GNU/Linux distributions. It has the main functionality of mpg123, but misses quite a number of goodies — like the downsampling to 8000Hz. Besides, it is also a dead project since 2002 or so...
Now, enter 2008! Thanks to the hard work of the mpg123 team, there is a current successor to the venerable 0.59 that
- fixes all known security bugs (overflows, etc.)
- fix all known playback problems of specific files
- is Free under the LGPL, thus able to re-replace mpg321 again in distributions
- since version 1.0 offers the decoder as a library
The revived mpg123 is entering standard distibutions at moderate pace... version 0.67 is in debian lenny, gentoo has 1.3 and 1.4 . Pkgsrc-wip is working on a current version. Clearly, there is still some work to do to make it known better and this posting is part of that. Also, personally, I would like to lower (to zero;-) the number of people who ask me about troubles they have with asterisk and some outdated mpg123 or even the faking mpg321.
So the first major message I would like to give to the asterisk community is that there is a current, active mpg123 and that the old way of calling it in a pipe to produce 8kHz pcm audio from MPEG files works just fine, provided you use a current one. The second message is: In case you want to avoid the trouble of external programs, that may even call themselves mpg123 although they aren't mpg123, you can use the libmpg123 that is provided by mpg123 since version 1.0 for an asterisk input module. There is API documentation on http://mpg123.org/api
Thomas Orgis, mpg123 maintainer.