In 2003 I converted over 25000 of invalid WAV files to MP3 ones using the sequence of commands:
sox file.wav file.cdr
lame file.cdr file.mp3
I used that intermediate method because it wasn’t possible to convert most of these WAV files using lame only. The command lame file.wav file.mp3 displayed in such cases the message:
Code:
Unsupported data format: 0x0002
Now I tried to convert the same WAV files using the same method but lame doesn’t recognize CDR audio format and complains:
Code:
Warning: unsupported audio format
It’s still possible to convert WAV files to MP3 ones using the sequence of commands:
sox file.wav file.raw
lame -s 11.025 file.raw file.mp3
The switch -s 11.025 in the above command is required because without it the resulting MP3 file plays the sound in an accelerated tempo.
Unfortunately when I use RAW audio format the sound in the resulting MP3 files isn’t clear.
So I wonder how can I convert these WAV files to MP3 ones. I see two possibilities:
1. Compile sox using lame and mad libraries.
2. Compile lame enabling CDR audio format.
I tried the first method updating sox sources with the following patch:
Code:
--- CMakeLists.txt 2009-02-12 21:33:57.000000000 +0100
+++ CMakeLists.txt 2011-05-21 17:00:47.000000000 +0200
@@ -65,6 +65,7 @@
optional(NEED_LIBM math.h m pow "")
if(NEED_LIBM)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} -lm)
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} mpglib)
endif(NEED_LIBM)
optional(EXTERNAL_GSM gsm/gsm.h gsm gsm_create "")
optional(EXTERNAL_LPC10 lpc10/lpc10.h lpc10 lpc10_create "")
In result I can convert WAV files to MP3 ones using sox:
sox file.wav file.mp3
Now I wonder how to achieve the same result enabling CDR audio format reading in lame because I prefer the second method. Unfortunately I haven’t idea how to enable that during the configuration of the sources of lame. Its documentation doesn’t mention about such switch.
So my question is: how can I compile lame enabling CDR audio format reading.