MP3 encoding using Lame

Audio software developers forum.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Mac OS X
GNU/Linux and Unix-like
Post Reply
Posts: 2
Joined: Wed Dec 12, 2007 3:42 pm
Operating System: Please select

MP3 encoding using Lame

Post by eQuinas23 » Wed Dec 12, 2007 3:55 pm

This is just a general question about MP3 encoding (perhaps I'm on the wrong forum but there's no harm in asking eh?)

Ok, here goes:

There are many programs (including Audacity) that use the Lame MP3 encoder to create one mp3 file from several audio files (mixdowns).
I would be every grateful for some information on how this is achieved.

From studying the Lame documentation, I can only find a reference to the conversion of single files, e.g. from the command prompt, Lame can be used to encode one file to another:

Code: Select all

lame [options] <infile> [outfile]
Is it possible to encode multiple files into one file from the command line? How does Audacity use Lame to produce a single mp3 file from multiple wav/mp3 files.

Any information would really be appreciated.

Thanks for reading.


Site Admin
Posts: 49424
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: MP3 encoding using Lame

Post by steve » Wed Dec 12, 2007 7:24 pm

In Audacity, mix down the audio into one track first.
Then "Export" as mp3.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Forum Staff
Posts: 9767
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: MP3 encoding using Lame

Post by waxcylinder » Thu Dec 13, 2007 10:32 am

You shouldn't need to mix into a single stereo track - the Export from Audacity should atomatically do the mix as part of the export.

No harm in doing the mix though (unless you want to go back to work on the tracks separately later.

________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * * Audacity Wiki * * * * *

Posts: 2
Joined: Wed Dec 12, 2007 3:42 pm
Operating System: Please select

Re: MP3 encoding using Lame

Post by eQuinas23 » Thu Dec 13, 2007 12:36 pm


thanks for both of your replies, but I'm afraid that you have misunderstood my question - which is my fault, I just read it back and realized that i should have been clearer.

I am trying to write a simple program that will convert 8 mp3 files into one mp3 file, accounting for parameters such as volume and pan for each mp3 file.
It's for a uni project that I'm struggling with a little. We can use any language but I'm not sure where to start.

Does anyone know how this can be achieved. All DAWs use this similar programs to mixdown. I'm just trying to write a similar function.

Any advice would really be appreciated.

Posts: 426
Joined: Tue Jul 31, 2007 1:57 pm
Operating System: Please select

Re: MP3 encoding using Lame

Post by richardash1981 » Fri Dec 28, 2007 3:56 pm

LAME is an encoding engine. It has nothing to do with mixing multiple audio files or joining them end to end, it just receives a single, continuous stream of sample and encodes them. For a simple command-line application that can be used to join and mix audio files, see As far as your program goes you either call SOX to do the work (if that's allowed), or read the data into arrays in memory, and do the mixing yourself - multiply each channel by the necessary gain, then add them up to get the sum (taking care to avoid clipping (overflow) if your values get too large, and noise (loss of precision) if they get too small).

Post Reply