[Asterisk-Users] Record() and problems converting with sox.

Kevin P. Fleming kpfleming at starnetworks.us
Tue Nov 30 14:33:56 MST 2004


Nick Barnes wrote:

> Which doesn't resolve my problem. How do I convert a wav (or ulaw, or alaw
> or whatever) to gsm? The example given on the wiki clearly doesn't work.

A little deduction is in order here...

If the source file is already 8KHz samples, then no resampling is 
necessary. Looking at the sox documentation, you'll see that the 
"resample" keyword is what is invoking the resample filter, so if you 
remove it (along with its -ql parameter), you won't get any more error. 
Since you're not resampling, the "-r 8000" is not needed either. If the 
source files came from Asterisk, then they are already mono, so "-c 1" 
is not needed.

In other words, to take a WAV file _created by Asterisk_ and turn it 
into GSM, this is all that is needed:

$ sox file.wav file.gsm

However, there is no "how do I convert a wav to gsm" simple answer. It 
depends entirely on what the source file contains, and what you want the 
destination file to contain. There is no cookie-cutter answer, unless 
you very strictly specify the input and output file specifications first.



More information about the asterisk-users mailing list