I’m trying to convert some MP3s to something that my 1.4 Asterisk can play.
I’ve started by converting the MP3s to wav and normalising using MediaMonkey.
Then using SOX, I can create the basic 8khz, mono .sln/.gsm files, but, most of my internal devices are HD audio capable (eg Yealink T22). So I’d prefer to create formats/qualities appropriate to them as well. I’ve tried using sox for creating-t ul and -t al (ulaw/alaw) formats, but I think its the bitrate I’m messing up.
If I do a show channel command on a call, it tells me that the MBR for most of my calls is 384kbps.
If I try using something like -r 64k instead of -r 8k it just gets put to 50% speed.
So I’m scratching my head on how to create files that internally would sound quite good, but externally would be 8khz.
Am I right in thinking as well that 1.4 can’t do 16kbps ??
I keep seeing references to running a convert from sln16 to g722, but, Asterisk complains about the RIFF header missing in my wav file that I present it after sox is used.
Then I saw a post saying that 1.6 onwards (or 1.4 patched) could support 16,32,64.
My idea was to load up .sln, .ulaw, .alaw, and now .g722 files so that it had a wide choice. Now I’m understanding that .sln, .ulaw/alaw seems to be 8bit/8kbps only - is that right ?
G.711 (A- and Mu-Law) is fundamentally 8 bits (14 bits of dynamic range piecewise linear logarithmically companded to 8 bits). I don’t have access to the ITU documents, but it would have been designed for 64kbits/s use, to encode analogue carrier quality audio (300Hz to 3.4kHz).
None of those are 8kbps. The nearest is GSM, at about 13.6, but that is vocoder based and unsuitable for normal music. I don’t think Asterisk understands wav8, as it is lower quality than the PSTN, but that would be 64kbps. The SLN is 128kbps and exceeds PSTN quality. It is 16kBps. Sampling at anything other than 8kHz gives no advantage when the PSTN is involved.
To get beyond PSTN quality, you need a codec that is supported by both the phone and Asterisk. I can no longer remember what is supported by Asterisk 1.4, which is obsolete, but I think it supports at least -r 16000 -w -s, although I don’t think that is supported by the SIP interface.
slin is supported by some phones, e.g. Digium phones, but it’s not a good idea for a codec, since it consumes 128kbp/s of bandwidth. slin16 doubles that to 256kbit/s, so it’s even more heinous - and it doesn’t sound perceptibly different from G.722.
Another note…most codecs were designed for carrying human speech, not music. So, MoH over G.729 is particularly icky.