Change Sample Rate to 16Khz

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.

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.

1 Like

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

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

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.

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

1 Like

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

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

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.