Hi all,
I’m trying to stream mp3 files for music on hold from an VLC player, so that I can control (play, pause, next song…) it.
In order to get that, I’ve configured the musiconhold.conf file to run the VLC application listening at UDP port 1234.
However, I can see that music is captured but nothing is played at the SIP devices (they support mp3 codecs).
The application needs to write audio to stdout. Not sure how to do that with vlc.
I was able to stream from vlc to asterisk using mg123 version 1.13.4.
Configure VLC to stream using HTTP and put this in your musiconhold.conf:
thank you thor!
But in that case, the quality wouldn’t be very high, right? In my case, I’d like to stream directly at a mp3 quality. Is it compulsory to set a 8000 kHz samplerate?
Thanx a lot!
Nearly all phone codecs are 8kHz. The PSTN is 8kHz, 8 bit, mu- or A-law. One or two phone codecs for local use are 16kHz. There is no way you will get MP3 quality over a phone system, in real time.
Many codecs are designed for speech use only, e.g. GSM, because they are based on a vocal tract model.
Let’s see if I get it right: So even if I had a device (not an IPphone) which is able to decode mp3 files and do all the SIP stuff (Register, receive calls…), Asterisk doesn’t support it and can’t send that kind of traffic.
As for the license, it’s just me who’s using this for the moment so don’t worry. I will look that up in the future…
Asterisk doesn’t have MP3 pass through support, because no VoIP phones support MP3, or 44kHz audio. You could write an MP3 format module for Asterisk, which would allow it to do so, but you would still have the problem of finding SIP or H.232 devices that supported MP3.
I am not sure if the Asterisk architecture can handle variable bit rate coding, and it might not like sample rates that are not divisible by 8000.
alright, thank you!!
this looks like i’ll have to get deeper so it’ll take some time…
By the way, can the streaming be made with UDP? I’ve tried but mpg123 doesn’t work properly…
Thanks again, bye!
After some little investigation…
Would it work if I changed res_musiconhold.c as explained in the link thor suggested (viewtopic.php?t=74366) for 48kHz samplerate? or is it just for 16kHz? And as for musiconhold.conf, would it be enough to add:
the format= specification must match the output from the program specified in application=
mpg123 can only do slin and g711(ulaw/alaw) so you can not use it to produce a g719 audio stream.
Note that asterisk10 adds support for higher bitrate slin codecs up to 192kHz:
Thank you thor!
So, coming back to the first situation, does anybody know which format VLC outputs the audio captured from streaming? or just how to configure it?
At the moment I’m using asterisk 1.8.8.4, and of course, if my end devices (some specific modules) don’t support the codecs it makes no sense turning the bitrate up…