How to convert .wav file to asterisk .wav format

Hi to all,
Hope you all will be fine. I send a wav file to asterisk but it is not palying by asterisk. It says that asterisk can understand only 16 bits/sample or something like this and my wav file is of course is not up to asterisk expectation. So i want to know how can i convert my wav file to asterisk format. Is there any software that i needed or just a command will be enough for this or both. My wav file name is msg0000.wav. Please help me how can i do it. Please explain in detail.

Thanks

Install and use SoX (http://sox.sourceforge.net/).

To convert a WAV file to a format understandable by Asterisk, convert it to GSM by running the following easy command:
sox input.wav output.gsm

Make sure the recording is in the format appropriate to telephony, ie sampled at 8kHz.

Hi,
Thanks. what do you mean by

you want to say that my input wav file should be sampled at 8khz. Is it? How would i come to know that at what sample my input file is.

Thanks

If you open it in a sound editor, you should get the information. You can use Audacity, for example.

You can convert a file from one sampling rate to another (the process called “resampling”, or “downsampling” if you are converting from higher sampling frequency to lower). You can even use SoX to resample the file, but you will usually get better results if the file is recorded at the correct sampling rate.

If you want to playback your own voice, for example, I suggest you download Audacity and record/save the file at 8kHz. If you need to resample an already existing use the following command
sox input.wav output.wav rate -v -I -s 8k

You can also use output.gsm instead of wav.

For the conversion i used the sound recorder of the windows XP accessories.
I opened the wav files and saved them as 16bit-8khz-mono files.

Bye

Giorgio

Hi,
Thanks.When i try to convert my wav file i get this

what this mean. But when i use

It works fine. But i have to convert my wav file to asterisk wav format. So please tell me what is sox saying.

Thanks

The instruction above are taken from the SoX website and refer to the newest version of the program.

If that doesn’t work, try this:

sox input.wav -r 8000 output.gsm resample -ql

This should work on slightly older versions of the program. If it doesn’t, I can only refer you to “man sox”.

Hi,
Thanks. This command worked for me.

Thanks.