Convert mp3 from mono to stereo using Lame
Solution 1
The answer to my own question is: No - it is not possible with lame
My work-around solution is to use the command-line tool sox
and do the channel duplication prior to mp3-conversion:
sox mono.wav -c 2 stereo.wav
Then afterwards use lame:
lame -m j stereo.wav stereo.mp3
Solution 2
You can do that with ffmpeg. Here is the command I used for mono mp3 files with 11025 Hz sampling rate and 40 kbps bitrate:
ffmpeg -i mono.mp3 -ac 2 -ab 96000 -ar 22050 stereo.mp3
Solution 3
You can use lame for this. With mono wav input, just use -m s
as lame option.
Using otherwise default lame options the output will be (simple) stereo.
EDIT: I was wrong! The original posters answer was correct: When the input wav is mono, you cannot get lame to make it stereo with -m s
.
Related videos on Youtube
ANisus
Starting with C64 basic in my childhood, going through Atari's STOS, Amiga's AMOS, Motorola 680x0 assembly, C and C++, I now work as a System Developer mainly using TSQL, PHP and C#. However, my hobby projects are currently focusing on Javascript (HTML5) on the client side and Go language on the server side.
Updated on November 22, 2022Comments
-
ANisus 12 months
An application requires that the mp3 files it receives are encoded with 2 channels (stereo), but the original files have only 1 channel (mono).
We use Lame for conversion, but i fail to make it clone the mono channel and create a fake stereo.lame.exe -m j mono.mp3 stereo.mp3
-m d
or-m s
doesn't seem to work either. Is it possible to do this with lame?-
SaintWacko about 11 yearsDo you have to just use LAME for this, or would you be willing to use Audacity?
-
ANisus about 11 yearsLame is called from within another application as a shell command. Audacity hasn't been considered as I thought it didn't have a useful command line interface. I surely may reconsider!
-
SaintWacko about 11 yearsOh, well, as far as I know, it doesn't have a command line interface. That's what I was wondering: why you needed to use LAME.
-
-
ANisus about 11 yearsAs I mentioned,
-m d
and-m s
didn't work either (or-m f
for that matter). It seems lame ignores it and creates a single-channel file nontheless. Double bitrate is a good suggestion :) -
Chake about 11 yearsSorry, I haven't seen that m(
-m i
doesn't work, too? there seems to be no option to assign each channel a input file... -
ANisus about 11 yearsBut the idea of using the same file twice for each channel is a good one. It would be one way to solve it for sure. I am also looking into it.
-
holms about 11 yearswell there's such thing as joint stereo which you basically used in here, which is actually means you dublicate mono channel.
-
ANisus about 11 years@holms Yes, that is what I use. The
-m j
will create a joint stereo, but as far as I know, it is not really a duplicate but rather encoding of the difference between the channels. And.. well.. since there is no difference in a duplicate, the added file size should be insignificant :) -
abekonge over 5 yearsNote that with a mono wav file as input, lame outputs joint stereo as default, unless you specify something else.
-
abekonge over 5 yearsthis was also wrong. Sorry.
-
Alexis Wilke over 3 yearsThat worked. They still put "Mono" in the INFO Tag, though, but otherwise I got the correct data.