4

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?

ANisus
  • 253
  • 3
  • 9
  • 1
    Do you have to just use LAME for this, or would you be willing to use Audacity? – SaintWacko Sep 06 '12 at 13:37
  • 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! – ANisus Sep 06 '12 at 13:49
  • 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. – SaintWacko Sep 06 '12 at 14:01

4 Answers4

5

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
ANisus
  • 253
  • 3
  • 9
  • well there's such thing as joint stereo which you basically used in here, which is actually means you dublicate mono channel. – holms Sep 12 '12 at 10:42
  • 1
    @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 :) – ANisus Sep 12 '12 at 11:37
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
Dzmitry
  • 141
  • 3
1

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.

abekonge
  • 11
  • 2
0

According to the LAME Documentation @Modes I would try "-m d". You should also consider to double your bitrate, because it is shared by two channels now, not one.

Chake
  • 161
  • 1
  • 6
  • 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 :) – ANisus Sep 06 '12 at 08:52
  • 1
    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... – Chake Sep 06 '12 at 09:04
  • 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. – ANisus Sep 06 '12 at 09:15