Error while playing sound files

Dear Friends,
I have an IVR set up for a client in Asterisk. Everything was working fine until my client updated his sound files with new ones.
Now, trying to play these files gives the following error. Note that .wav files were palyed successfully earlier for this application

Executing [121@default:1] BackGround(“SIP/8080-0821b1d8”, “29”) in new stack
[Oct 29 23:45:00] WARNING[2834]: format_wav.c:201 check_header: Unknown block - not fact or data
[Oct 29 23:45:00] WARNING[2834]: file.c:316 fn_wrapper: Unable to open format wav
[Oct 29 23:45:00] WARNING[2834]: file.c:814 ast_streamfile: Unable to open 29 (format 0x4 (ulaw)): No such file or directory
[Oct 29 23:45:00] WARNING[2834]: pbx.c:5673 pbx_builtin_background: ast_streamfile failed on SIP/8080-0821b1d8 for 29

It can be seen that asterisk says it cannot find the file specified, but this works fine when I rename an old working file to ‘29.wav’ and place in the sounds folder. And the error appears when I replace it with actual 29.wav. This shows that the file IS there at place but however asterisk has problems reading it or decoding it.

This may be a trivial case, but as a newbie to asterisk, a solution to this is appreciated.

Thanks in advance.

What are the file permissions for the new file ?

Ian

It’s actually saying that the .wav files are corrupt, not that they are missing. It is the ulaw files that are missing.

Hi,
Thanks for the reply.
@ianplain : the wav files have all the required privileges for sure (read/write/exec – 777)

@David : David, are you sure that the files are corrupt ? because I can play these files successfully in my media player without any problems. And you also mentioned that the ulaw files are missing. Is it possible for me to install these ulaw files? f yes, please let me know how I can get these and install ( format 0x4 (ulaw) if Im not wrong).

Please let me know your views.
Thanks in advance.

You can’t simply rename files. They have to be created in the correct format.

Perhaps you have .gsm files or something instead of .wav.

What it is actually saying is that there is something in the wav files that it doesn’t understand. That might be because they are corrupt, but might be because they were created with too sophisticated a program.

WAV covers a large number of formats, and only one is really acceptable to Asterisk.

Digium have several file formats. Other suppliers may not have all of them.

hi dufus,
The files were wav earlier, and are wav now. Only the content has changed and not the format. I am sure that these are wav files may be encoded somewhat differently than earlier

okay. now do I have any method to convert these files to a format acceptable by asterisk?
and is it sure that the error is due to unsupported format?

Can you try these sox and file commands on one of the files, to try and see what you have actually got. If the format is recognizable, sox may also be able to do the conversion:

[root@centos en]# sox -V zip-code.wav /dev/null
sox: Detected file format type: wav

sox: WAV Chunk fmt
sox: WAV Chunk data
sox: Reading Wave file: Microsoft PCM format, 1 channel, 8000 samp/sec
sox: 16000 byte/sec, 2 block align, 16 bits/samp, 13970 data bytes
sox: 6985 Samps/chans
sox: Input file zip-code.wav: using sample rate 8000
size shorts, encoding signed (2’s complement), 1 channel
sox: Unknown output file format for ‘/dev/null’:
[root@centos en]# file zip-code.wav
zip-code.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono
8000 Hz

Hi David,
Executing the commands given by you gives the following messages…

[root@asterisk temp]# sox -V 27.wav /dev/null
sox: Detected file format type: wav

sox: WAV Chunk fmt
sox: WAV Chunk PAD
sox: WAV Chunk data
sox: Reading Wave file: Microsoft PCM format, 1 channel, 8000 samp/sec
sox:         16000 byte/sec, 2 block align, 16 bits/samp, 204960 data bytes
sox:         102480 Samps/chans
sox: Input file 27.wav: using sample rate 8000
        size shorts, encoding signed (2's complement), 1 channel
sox: Unknown output file format for '/dev/null':
[root@asterisk temp]# file 27.wav
27.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz
[root@asterisk temp]#

It’s in the right basic format, but it looks like Asterisk doesn’t understand:

You may be able to convert it, using sox, directly. However, if it proves too clever and copies the PAD chunk, you will need to convert to raw sound samples, at the same rate, etc., then convert back to .WAV.

I’m afraid you are going to have to find out how to use SOX yourself, as I don’t use it often enough to know what to do without careful reading of the documentation.

Thankyou David for your guidance.
I shall check if sox can convert this to our desirable format.
Help from somebody who has run into similar problem and fixed it, or anyone who have an idea of how sox commands work would be highly appreciated.