I would like to convert wav files to mp3 using the lame encoder (lame.exe). The wav files are recorded along the following specifications:

Bit Rate: 64kbps
Audio sample size: 8 bit
Channels: 1 (mono)
Audio sample rate: 8 kHz
Audio format: CCITT A-Law

If I try to convert such a wav file using lame, I get the following error message:

Unsupported data format: 0x0006

Could anyone provide me with a command line string using lame.exe that will enable me to convert these kind of wav files?

link|improve this question
what command line are you using currently? – Jeff Shattock Oct 28 '09 at 23:28
feedback

migrated from stackoverflow.com Oct 28 '09 at 15:49

This question came from our site for professional and enthusiast programmers.

2 Answers

You want to use SoX to convert the A-law input data to a more standard PCM data for LAME to process.

sox -A -c 1 -r 8000 input.8khz-mono-alaw.wav ouput.wav

Now output.wav should contain standard PCM WAV data. Run your LAME command on this (add whatever options you like):

lame output.wav output.mp3

Or, pipe the SoX output into LAME directly:

sox -A -c 1 -r 8000 input.8khz-mono-alaw.wav - | lame - output.mp3
link|improve this answer
feedback

download and compile libsndfile I used version 1.0.17 download the source for lame and then use this configure setting

./configure --with-fileio=sndfile

then

make && make install

now it will work.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.