Playing MP3’s In Asterisk
Hi,
Does anyone know what code (if any) format_mp3 uses? I am trying to play a MP3 (e.g. https://mp3.sermonaudio.com/16kbps/6111963257014/6111963257014.mp3)
using PlayBack. Iget the famous “mp3/interface.c: Junk at the beginning of frame 49443304” and then right away it exits the PlayBack Application. I
know I can use ffmpeg on the fly. I am currently getting the URL to play via an API and then I want to play it directly from Asterisk. I would rather not have to dl every file, convert it and then play it.
TIA.
Dovid
5 thoughts on - Playing MP3’s In Asterisk
Hi !
Which Asterisk version do you use?
Asterisk uses the mpg123 library.
Regards,
Ludovic
—
https://drolez.com/blog – Marketing automation and Web dev https://chezsandro.com – A cool place in Cape Verde 🙂
https://aopensource.com – Android Open Source Portal
—
Ludovic,
Currently using Asterisk 14.5.0 with
[root@a1-c2-nyc3 ~]# rpm -qa | grep mpg123
mpg123-1.25.6-1.el7.x86_64
mpg123-libs-1.25.6-1.el7.x86_64
mpg123-devel-1.25.6-1.el7.x86_64
[root@a1-c2-nyc3 ~]#
Should I be using a newer version of mpg123?
Hi all,
Returning to the issue of mp3 support in Asterisk, it seems it is using a build from 1997?!
http://svn.digium.com/svn/thirdparty/mp3/trunk/layer3.c
I have the same problems as everyone with the mp3 add-on, but now a new one:
– “mp3/interface.c: Junk at the beginning of frame 49443304” for ALL mp3
files, even when debug/verbose is off.
– Very quiet playback compared to slin, so I have to control the
outgoing volume by +7 for mp3 playback.
– Now I find it chokes on mp3s which have a png cover art – this is
perfectly valid in mp3 id3
But I still need to use ControlPlayback from dialplan and f-agi.
I started going down a rabbit-hole of ARI media and Audiosocket etc, for example:
https://www.youtube.com/watch?v=tjduXbZZEgI
https://github.com/CyCoreSystems/audiosocket
These all seem to add a fair amount of complexity for controlling playback
– for example:
https://wiki.asterisk.org/wiki/display/AST/ARI+and+Media%3A+Part+2+-+Playbacks#ARIandMedia:Part2-Playbacks-Controllingplaybacks And I need to know the current cplaybackoffset at any given time.
I was thinking: to keep it simple, is there a way to tell Asterisk to use a different mpg123 (the system one – my currently installed version from
2020!) instead of the Asterisk build?
I can live with the “junk” warnings and the quiet playback, but it cannot be crashing on valid id3 content (and I have no control over the remotely hosting files).
Thanks for any pointers in the right direction!
John,
In what application are you using mp3’s? In my case it was for music on hold. I simply had asterisk call ffmpeg to play the files (to get around all the issues). Where I have local files I convert them over to wav or gsm and call it a day.
Thank you,
I’m using ControlPlayback, Playback, Background etc from dialplan and AGI
… not MoH. All the files are remote so no conversion possible.
Thanks