[Asterisk-Users] Why does * only work with an ancient mpg123?
Eric Wieling aka ManxPower
eric at fnords.org
Mon Dec 20 13:51:18 MST 2004
Remco Barende wrote:
> On Mon, 20 Dec 2004, Eric Wieling aka ManxPower wrote:
>
>> Remco Barende wrote:
>>
>>> Hi list!
>>>
>>> Just wondering, why is * sticking with an mpg123 version from the
>>> stoneage?
>>>
>>> Gentoo comes with 0.59s-r8 and this version doesn't even start.
>>>
>>> Ik know I could forcibly unmerge mpg123 and install the old version
>>> but I guess some day newer versions will have to be supported?
>>
>>
>> Asterisk sets the following mpg123 options:
>>
>> "mpg123 -q -s --mono -r 8000 -b 2048 -f 4096"
>>
>> -q, --quiet Quiet. Suppress diagnostic messages.
>>
>> -s, --stdout The decoded audio samples are written to standard
>> output, instead of playing them through the audio device. This option
>> must be used if your audio hardware is not supported by mpg123.
>> The output format is raw (headerless) linear PCM audio data, 16
>> bit, stereo, host byte order.
>>
>> -r rate, --rate rate Set sample rate (default: automatic). You may
>> want to change this if you need a constant bitrate independed
>> of the mpeg stream rate. mpg123 automagically converts the rate. You
>> should then combine this with --stereo or --mono.
>>
>> -b size, --buffer size Use an audio output buffer of size Kbytes.
>> This is useful to bypass short periods of heavy system activity,
>> which would normally cause the audio output to be interrupted.
>> You should specify a buffer size of at least 1024 (i.e. 1 Mb, which
>> equals about 6 seconds of audio data) or more; less than about 300
>> does not make much sense. The default is 0, which turns buffering off.
>>
>> -f factor, --scale factor Change scale factor (default: 32768).
>>
>> Pretty much any program that accepts these options to generate raw
>> (headerless) linear PCM audio data, 16 bit, mono, host byte order, at
>> 8khz to stdout will work. At this time the only one that does this
>> that I know is mpg123 0.59r
>
>
> Thanks! But when I look at the output of mpg123 0.59s-r8 all these
> commandline switches are still supported, why it it only the old version
> that is supported, not the newer ones?
If all the options are supported then there is no reason that it would
not work.
Try this command at the command line:
mpg123 --mono -r 8000 -b 2048 -f 4096 /var/lib/asterisk/mohmp3/*.mp3
Does it play via the speakers? If not then there is no way it will work
with Asterisk.
You can also try all on one line, this won't require speakers on your
system:
mpg123 -s --mono -r 8000 -b 2048 -f 4096 /var/lib/asterisk/mohmp3/*.mp3
> /dev/null
Asterisk just calls mpg123 with specific parameters. It does no
checking whatsoever of the mpg123 version.
--Eric
More information about the asterisk-users
mailing list