Convert mp3 from mono to stereo using Lame

6,406

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.

Share:
6,406

Related videos on Youtube

ANisus
Author by

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, 2022

Comments

  • ANisus
    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
      SaintWacko about 11 years
      Do you have to just use LAME for this, or would you be willing to use Audacity?
    • ANisus
      ANisus about 11 years
      Lame 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
      SaintWacko about 11 years
      Oh, 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
    ANisus about 11 years
    As 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
    Chake about 11 years
    Sorry, 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
    ANisus about 11 years
    But 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
    holms about 11 years
    well there's such thing as joint stereo which you basically used in here, which is actually means you dublicate mono channel.
  • ANisus
    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
    abekonge over 5 years
    Note that with a mono wav file as input, lame outputs joint stereo as default, unless you specify something else.
  • abekonge
    abekonge over 5 years
    this was also wrong. Sorry.
  • Alexis Wilke
    Alexis Wilke over 3 years
    That worked. They still put "Mono" in the INFO Tag, though, but otherwise I got the correct data.