Change Sample Rate to 16Khz


#1

I am using record function in asterisk AGI and saves output file has a sampling rate of 8k, I would like to get a higher rate at 16k.
I understand that recording sampling rate reflects sampling rate of incoming audio and codec used but I lack understanding of how asterisk manages this and it may be the case of recording system downsampling the audio.

If you have ideas on how to get higher sampling rate implemented I will appreciate it.


#2

Select a 16kHz codec; most are 8kHz (e.g. alaw, mulaw and gsm are all 8kHz). Ensure that is used end to end on the call. Select the file type corresponding to that codec, for the recording.


#3

I guess this will only work if carrier supports higher the codec


#4

Which is unlikely, as the PSTN does not support them.


#5

G.722 samples at 16 kHz.
However, it might not be supported by an ISP which would be a blocking factor if you are recording external calls.


#6

Moreover any call that hits the PSTN is limited to 8kHz.


#7

I was able to resample audio files to 16k using “sox rate 16k”


#8

They will still be limited to about 3.4kHz bandwidth and the audio quality will be no better (probably very very slightly worse).


#9

Sometimes you just need to end up with specific sample rate in the end so there is no need to resample in bulk later.

But I understand and agree that upsampling is not going to give anything, in terms of quality, what it does give is more of the same data by volume and sometimes that is what is needed.