When talking between 2 SIP devices using G.722 the audio is excellent.
When using a SIP device and G.722 to record a prompt using the Record() command, the audio sounds like it was first transcoded to 8000Hz even though I request a fileformat of sln16 and the resulting file is at 16000Hz.
How can I record prompts using a SIP device and G.722 and keep the same audio quality as when 2 SIP devices talk using G.722?
You can specify the format of the audio file in Record() (or MixMonitor()). Have you checked what’s in your dial plan?
Yes I have tried with sln16, sln32 and g722.
Interesting. Can you verify the 8K? You could load a file into Audacity and the spectrum will show only energy below 4K.
If an external phone is part of it, then I would assume that you hardly get anything more than the 8k.
I am using 2 SIP phones connected to the Asterisk server.
When using Record() The spectrum is cut between 4K and 5K. See screenshot here: https://www.dropbox.com/s/49h0mc6wl21e0aj/record1.png?dl=0
But if I use tcpdump and extract the RTP/audio of a conversation with Wireshark - then the spectrum goes all the way up to 11K. See screenshot here: https://www.dropbox.com/s/it54vp5iclp578c/record2.png?dl=0
That is why I suspect that Asterisk is doing some sort of transcoding, even though “core show translation paths g722” shows that the path to sln16 is “g722:16000 To slin:16000 : (g722@16000)->(slin@16000)”.
This is not what one would expect with 8kHz. I’ll prepare some of my data to demonstrate the differences. It might take a couple of days, though…
8ks/s audio would be expected to roll off steeply at 3.4KHz.
Similarly, 16ks/s audio would be expected to roll off from 6.8kHz.
If you see energy at anything above 8kHz, the anti-aliasing is broken.
The sub-band nature of G.722 may mean you can create sharper anti-aliasing filters, but energy at 11kHz, is still a fault condition. WP reckons the cutoff is 7kHz.