|
From: Jan S. <ha...@st...> - 2010-08-17 09:53:55
|
> [root@asterisk testing]# file testExtended.wav > testExtended.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, > 16 bit, stereo 44100 Hz What does soxi(1) say about the file? > [root@asterisk testing]# file testLong.wav > testLong.wav: RIFF (little-endian) data, WAVE audio, 20294 channels > 1414676809 Hz I very much doubt that you have a 202294-chanel file with a samplerate of 1414676809 Hz. The wav header of this file is probably broken. What does soxi say about the file. Is play(1) able to play it? > to mono : > sox testExtended.wav -r 8000 -c1 testExtended2.wav resample -ql > sox sox: effect `resample' is deprecated; see sox(1) for an alternative Why are you using deprecated effects?? sox -V testExtended.wav testExtended2.wav remix - rate 8000 sox -V testExtended.wav -c 1 -r 8000 testExtended2.wav > [root@asterisk testing]# sox testLong.wav -r 8000 -c1 testLong2.wav > resample -ql > sox sox: effect `resample' is deprecated; see sox(1) for an alternative > sox effects: resample clipped 2 samples; decrease volume? Again, why are you using 'resample'? That's a deprecated alias for 'rate', which you already specified with the '-r 8000'. > afterwards : > [root@asterisk testing]# file testLong2.wav > testLong2.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 > bit, mono 8000 Hz Looks good; what does soxi(1) say about the file? Can you play the resulting mono/8000 file? > [root@asterisk testing]# file testExtended2.wav > testExtended2.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, > 16 bit, mono 8000 Hz It seems that sox somehow converted the original file (which most likely is _not_ a 20294c/1414676809Hz file) into a mono/8000. It would be useful to know the output of 'sox -V' wehn running this. Are you able to play the file? > But my Asterisk-server can not open them : > [root@asterisk testing]# asterisk -rx "file convert testExtended2.wav > testExtended2.alaw" > Unable to open input file: testExtended2.wav > [root@asterisk testing]# asterisk -rx "file convert testLong2.wav > testLong2.alaw" > Unable to open input file: testLong2.wav That has nothing to do with sox, right? Ask on the asterisk mailing list. > The file has decreased in file size : > -rw-r--r-- 1 root root 885K 2010-08-17 08:59 testExtended2.wav > -rw-r--r-- 1 root root 9.6M 2010-08-17 08:57 testExtended.wav Of course. Both the number of channels and the sample rate have been reduced, so the file size got reduced, too. (Are you sure you know what a 'sample rate' is?) The numbers seem right: the new file's size is about a ((1*8000)/(2*44100))-th of the old one. > I can play the original and the resampled file perfectly in Gnome > Mplayer, but my Asterisk-server can not read the file to convert it to > alaw. Could there be something wrong with the wav-file ?! 9.6M and 885K is small enough to put the files somewehere on the web so we can look at them. |