Converting .wav (CCITT A-Law format) to .mp3 using LAME
10,348
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
Related videos on Youtube
Author by
George
Updated on September 17, 2022Comments
-
George almost 2 years
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-LawIf 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?
-
Admin over 14 yearswhat command line are you using currently?
-
-
Josh Smeaton over 10 yearsthank you thank you thank you. I was incorrectly using -e signed-integer instead of -e a-law (your -A argument for older version of sox).
-
Josh Smeaton over 10 yearsAnd I'd like to recommend not piping sox to lame, as you may get missing header information since sox waits for the file to close before writing certain headers.