Sound file quality

I’ve been asked to put together a IVR and given the necessary sound files for the IVR. However, to get them to work I had to put them through an audio convertor to reduce the frequency. The converter is used was:

What is the best quality sound file that can be used?

Any help or advice on this matter would greatly be appreicated.

Best is really in the eye of whatever the listening device supports.

It’s best to have files in the native format of the connecting device; that reduces transcoding & resampling. Downsampling a 16kHz file to 8kHz to get it to a G.711 law device, on-the-fly, doesn’t produce better results in perceptible audio quality than beginning with an 8kHz file.

Thank you for your input, this might be a naive question but why is 8khz the highest sample rate?

Is that because it’s the highest rate support by a connection over a PRI?


It isn’t. Asterisk can sample at much higher rates than that.

I’m just pressing the point that sampling at a high rate inside of Asterisk isn’t of much use if the things outside of Asterisk aren’t sampling at that same rate. There’s no reason to sample a conference bridge at 48kHz if your participants will show up using nothing grander than G.722.

If you store all of your sound files as 48kHz signed linear files, but your clients were 8kHz a-law clients or 16kHz G.722 clients, then you’d have to down-sample each of those sound files, and downsampling costs CPU cycles.

Again, I really appreciate the reply but unfortunately leads me to more questions. First off, when I create my IVR and try to play (Background) my wav file which is higher than 8khz it doesn’t play? As soon as I lower the rate to 8khz it works.

Also, am I worrying about something that doesn’t matter. The IVR is solely being used for calls coming in over a PRI. Is 8khz the highest sample rate that can playback over that connection?

Again, your help has been greatly appreciated.


Voice channels on a PRI operate using G.711 u-law or a-law coding; 8kHz.

I don’t know why your sound files at something greater than 8kHz aren’t playing back properly.


The sampling rate in the file has to match the default sampling rate for the corresponding codec in Asterisk. .wav files are treated as being in the SLIN codec, which is 16 bit samples at 8kHz rate. Asterisk doesn’t adapt to the metadata in .wav files.

8kHz is the Nyquist rate for 4kHz bandwidth. That was the carrier spacing on analogue multiplexes, and is based on the fact that most of the frequencies necessary for speech lie between 300Hz an 3.4kHz, giving 4kHz when you allow for reasonably realisable channel filters. For digital systems, it is the anti-aliasing filters than need to be realised. A lot of work has gone into making telephony systems efficient, and any better sound quality just wastes bandwidth.

Thanks for all the replies, they have been extremely helpful.

How can i setup asterisk to play wav files with a higher sample rate?

Please start a new thread. Asterisk only supports RIFF (.wav) in signed linear 16 bit 8kHz mono, and GSM formats (the latter also 8kHz). For other rates you need to use files without the RIFF wrapper. You can pre-convert with, for example, sox.

As pointed out above, it is best to convert to all the codecs actually in use, offline, and also note that higher bandwidth files may not offer any advantage in the real world.