[asterisk-users] sox: Failed reading obd-demo.mp3: Do not understand format type: mp3

Kaushal Shriyan kaushalshriyan at gmail.com
Tue Sep 13 20:05:32 CDT 2011


On Tue, Sep 13, 2011 at 6:47 PM, Matthew J. Roth <mroth at imminc.com> wrote:
> Kaushal,
>
> Your version of SoX does not have MP3 support.  Since you have LAME
> installed, use it as a first step to produce an intermediate file
> that SoX supports.  Then use SoX to convert the intermediate file
> to the desired format.
>
> Step 1
> ------
>
> # lame --decode obd-demo.mp3 obd-demo.wav
> input:  obd-demo.mp3  (8 kHz, 1 channel, MPEG-2.5 Layer III)
> output: obd-demo.wav  (16 bit, Microsoft WAVE)
> skipping initial 1105 samples (encoder+decoder delay)
> Frame# 16818/16818   16 kbps
> # file obd-demo.wav
> obd-demo.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz
>
>
> Step 2
> ------
>
> # sox -V obd-demo.wav -r 8000 -b -t ul -c 1 obd-demo.ulaw
> 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, 19372126 data bytes
> sox:         9686063 Samps/chans
> sox: Input file obd-demo.wav: using sample rate 8000
>        size shorts, encoding signed (2's complement), 1 channel
> sox: Output file obd-demo.ulaw: using sample rate 8000
>        size bytes, encoding u-law, 1 channel
> sox: Output file: comment "Processed by SoX"
>
>
> Regards,
>
> Matthew Roth

Thanks Matthew Roth. It worked. Also please let me know the difference
between .ulaw and .alaw format and is there a way i can play this file
formats.

Regards

Kaushal



More information about the asterisk-users mailing list