Lame Installation

Legal issues
While the LAME source code is free, the encoding technology that ready-compiled LAME binaries use is patented. The patents are held by Fraunhofer and administered by Thomson. Patenting raises a theoretical possibility that in some countries a user might need to pay a licence fee to legally encode MP3s. This might vary according to the purpose of the encoding and whether the software being used is licensed.

There is no definitive list of countries where the patents unambiguously hold sway. However they are generally assumed to be enforceable in USA, Canada, the EEC and Japan. This means that in these countries (in theory), software that encodes MP3s must be licensed by the patent holders, and that anyone encoding MP3s with unlicensed encoders may also be infringing patents.

The best advice that can be given is that the user makes their own decision, based on their conscience, the country they are in, and taking into account the following:
 * The patent holders have tended to enforce licence fees against commercial rather than free MP3 encoders
 * Thomson themselves have said that no license is needed by individuals creating music libraries of MP3 files for personal use (interpretations vary whether that sanctions using unlicensed encoders, free or otherwise)
 * Existing MP3 patents will expire worldwide between 2010 and 2012 (but not until 2017 in the USA)
 * The possibility remains at least in the USA that patents could be extended.

For 1.3.3 and later users
First, if you are using Audacity 1.3.3 or later, try exporting an MP3 straight away! 1.3.3 or later on Windows will look automatically in your system folders for the LAME encoder. If you already have it, you can export an MP3 by clicking, then in the Export File dialogue, choose MP3 Files  in the Save as type dropdown, and click Save. After completing the Metadata Editor for your ID3 tags (just click OK if you don't want to change the tags), you should see the progress bar for the MP3 export. Otherwise, you will see the "Locate Lame" dialogue. If that occurs, press "Cancel" and proceed as per the following "All users" section.

All users

 * 1) Download an unzipped copy of the required lame_enc.dll here Left-click this link, do not right-click
 * 2) Do not open this file, but save it to your computer. As you will be using this .dll file directly for encoding it is recommended to save it into your Audacity installation folder. This is normally at . Once lame_enc.dll is saved to your computer:
 * 3) Launch Audacity, click then the .  Note: In Audacity 1.2.x, it may be necessary to click the left-pointing arrow top right of the window to reveal the tab. In Audacity 1.3.4 this tab is called ; in 1.3.5 - 1.3.7 ; in 1.3.8 or later .
 * 4) Look for the MP3 Export section.
 * 5) Click on the "Find Library" or "Locate..." button
 * 6) In Audacity 1.2.6 this will ask if you want to locate the LAME encoder. Click "Yes". In Audacity 1.3.3 or later, click the "Browse" button
 * 7) In the dialogue box, go to the folder where you put lame_enc.dll earlier, and select it.
 * 8) Click Open, then OK.

In the same "MP3 Export Setup" section, you can then in Audacity 1.2.6 set the bit rate of the exported MP3 by clicking on the downward pointing arrow in the "Bit Rate" dropdown.

In 1.3.3 or later, click, then choose MP3 in the "Save as type" dropdown and click the "Options" button to choose bit rate in the "Quality" dropdown. The default bit rate is 128 kbps in both versions of Audacity. A higher bit rate gives you higher quality at the expense of a larger filesize, and vice-versa. A 128 kbps bit rate takes up about 1 MB of space per minute. The "Options" button also gives access to more advanced MP3 encoding options as follows:


 * 1) Bit Rate Mode (Variable, Average, Constant or use a Preset)
 * 2) Encoding Speed (with other than constant bit rate encoding)
 * 3) Channel mode (currently Stereo or ).

Constant bit rate with stereo channel mode is always used by Audacity 1.2.5/6. Variable bit rate tends in most genres to give higher quality for the same bit rate.

Additional encoding options such as higher quality algorithms are available by choosing "external program" in the "Save as type" dropdown, then specifying the relevant commands to be passed to your MP3 encoder (such as LAME) in the dialogue box.

Advanced options for MP3 encoding
Currently, using lame_enc.dll in Audacity 1.2.6 doesn't permit encoding MP3s with more advanced options such as variable bit rate (VBR), higher quality (slower) algorithms or.

If these advanced options might be useful to you, you can export as a WAV file from Audacity and use LAME.exe at the command line (or in a third party program that provides an interface for it,) or use other programs that use different MP3 encoders. Alternatively the 1.3.3 or later versions of Audacity now provide advanced encoding options - see below.

Audacity 1.2.6 with LAME at the command line
If you want to use Audacity 1.2.6 with lame.exe at the command line, download and unzip this LAME package. As well as lame_enc.dll for use in Audacity, it includes lame.exe and LAME usage documentation. You can also view the usage documentation online.

To use lame.exe, run it separately from Audacity (for example at the command line) on uncompressed WAV or AIFF audio files exported from your Audacity Project. To run LAME at the command line, open a command prompt from the folder location you unzipped it to, in the syntax:


 * lame [options] [outputfile].

Windows Vista and 7 can open a command prompt at any folder location by holding while right-clicking over the folder. Methods for adding an easy command prompt shortcut to pre-Vista systems are listed here.

You can also drop a .WAV or .AIFF file onto lame.exe. The MP3 will be encoded using default options and saved in the folder containing lame.exe.

Audacity 1.2.6 with other programs
You can use LAME.exe in an interface with menus and buttons in. This program has almost all the options offered by LAME.exe in a compact standalone interface. You'll need an unzipped copy of LAME.exe to be present in the RazorLame installation folder.

Many of the LAME encoding options are also available in a self-contained program called CD-EX. This does not need LAME.exe to be present on the computer. CD-EX is also a fine tool for extracting audio from CDs.

You can also use the Windows version of iTunes to encode to MP3 using its own proprietary MP3 encoder.

Audacity 1.3.3 and later
From 1.3.3 onwards, the advanced encoding options are accessible in the "Options" button when you export as MP3, as described above. The new 1.3.3 export options are for:


 * 1) Bit Rate Mode (Variable, Average, Constant or use a Preset)
 * 2) Encoding Speed (with other than constant bit rate encoding)
 * 3) Channel mode (currently Stereo or.

Constant bit rate with stereo channel mode is always used by Audacity 1.2.5/6. Variable bit rate (VBR) tends in most genres to give higher quality for the same bit rate.

Additional encoding options (such as those allowing the use of higher quality algorithms or a wider range of bit rates in VBR MP3s) are available by choosing "external program" in the "Save as type" dropdown when you export as MP3. In the dialogue, enter the required commands to be passed to your MP3 encoder such as LAME.exe. It's recommended to place the encoder in the Audacity installation folder. Some suggested commands giving high quality, high efficiency encoding for larger or smaller file sizes can be found. For example, the highest quality (largest file size) setting recommended on that page would be entered thus in the Audacity Command Line Export dialog: lame -V1 --vbr-new -b112 --lowpass 21 -q0 - "%f"

Downloading and installing
Left-click the below links, do not control-click

OS X
 * OS X 10.4 or later, Intel or PPC Mac: Use the current Audacity and Lame Library v3.98.2 for Audacity.dmg.


 * OS X 10.0 to 10.3, Intel Mac: Use Audacity 1.2.5 and libmp3lame-osx-universal-3.97.zip.


 * OS X 10.0 to 10.3, PPC Mac: Use Audacity 1.2.6 and LameLib-Carbon-3.91.sit.

OS 9
 * Use Audacity 1.0.0 and LameLib-Carbon-3.91.sit.

Next, go to the instructions for LameLib-Carbon-3.91.sit, Lame Library v3.98.2 for Audacity.dmg or libmp3lame-osx-universal-3.97.zip.

LameLib-Carbon-3.91.sit

 * 1) When you have finished downloading, extract the files with Stuffit or similar (this may happen automatically)
 * 2) Save the file called "LameLib" anywhere on your computer
 * 3) Launch Audacity, click then the  Note: it may be necessary to click the left-pointing arrow top right of the window to reveal the tab
 * 4) Look for the MP3 Export section
 * 5) Click the "Find Library" button
 * 6) This will ask if you want to locate the LAME encoder; click "Yes"
 * 7) In the dialogue box, go to the folder where you put the unstuffed "LameLib" file earlier, and select it.
 * 8) Click Open, then OK

Lame Library v3.98.2 for Audacity.dmg

 * 1) When you have finished downloading, double-click the .dmg to mount it, then go to the Finder (in Safari, "Lame Library v3.98.2 for Audacity.pkg" will be extracted automatically after downloading).
 * 2) Double-click "Lame Library v3.98.2 for Audacity.pkg". This will install the LAME binary "libmp3lame.dylib" in /usr/local/lib/audacity
 * 3) If Audacity asks where the MP3 encoding library is when you export as MP3:
 * 4) Click  then the   Note: in Audacity 1.2, it may be necessary to click the left-pointing arrow top right of the window to reveal the tab. In Audacity 1.3.4 this tab is called ; in 1.3.5 - 1.3.7 ; in 1.3.8 or later .
 * 5) Look for the MP3 Export section
 * 6) Click the "Find Library" button
 * 7) In Audacity 1.2, this will ask if you want to locate the LAME encoder; click "Yes" (in Audacity 1.3.x or 2.x.x, click "Browse")
 * 8) In the dialogue box, navigate to /usr/local/lib/audacity, and select "libmp3lame.dylib"
 * 9) Click Open, then OK

libmp3lame-osx-universal-3.97.zip

 * 1) When you have finished downloading, use an expander such as Stuffit or Springy to extract the files
 * 2) Save the file "libmp3lame.dylib" anywhere on your computer - it's located at the bottom of the "package" folder at libmp3lame-osx-universal-3.97/package/usr/local/lib
 * 3) Click  then the  Note: in Audacity 1.2, it may be necessary to click the left-pointing arrow top right of the window to reveal the tab
 * 4) Look for the MP3 Export section
 * 5) Click the "Find Library" button
 * 6) In Audacity 1.2, this will ask if you want to locate the LAME encoder; click "Yes" (in Audacity 1.3.x or 2.x.x, click "Browse")
 * 7) In the dialogue box, navigate to the folder where you put the unstuffed "libmp3lame.dylib" file earlier, and select it.
 * 8) Click Open, then OK

Setting bit rate and other options
Audacity 1.2.5/6: Click the menu option "Audacity > Preferences" and select the "File Formats" tab. In the "MP3 Export Setup" section (towards the bottom), set the bit rate of the exported MP3 by clicking on the downward pointing arrow in the "Bit Rate" dropdown.

Audacity 1.3.3 or later: Click, then choose MP3 in the "Save as type" dropdown and click the "Options" button to choose bit rate in the "Quality" dropdown. The default bit rate is 128 kbps in both versions of Audacity. A higher bit rate gives you higher quality at the expense of a larger filesize, and vice-versa. A 128 kbps bit rate takes up about 1 MB of space per minute. The "Options" button also gives access to more advanced MP3 encoding options as follows:


 * 1) Bit Rate Mode (Variable, Average, Constant or use a Preset)
 * 2) Encoding Speed (with other than constant bit rate encoding)
 * 3) Channel mode (currently Stereo or Joint Stereo

Constant bit rate with stereo channel mode is always used by Audacity 1.2.5/6. Variable bit rate tends in most genres to give higher quality for the same bit rate.

Additional encoding options such as higher quality algorithms are available by choosing "external program" in the "Save as type" dropdown, then specifying the relevant commands to be passed to your MP3 encoder (such as LAME) in the dialogue box.

Previous Intel Mac naming issue with Universal Binary
An early version of http://spaghetticode.org/lame/libmp3lame-osx-universal-3.97.zip mistakenly named the included MP3 encoding binary as libmp3lame.so instead of the libmp3lame.dylib which Audacity asks for. If you have this problem, please download the latest version.

Assertion error with LAME on Power PCs
Users on Power PCs may see an "assertion error" when exporting MP3s from Audacity. This is due to a bug in the LameLib binary that Audacity uses. This binary is v3.91 and outdated, but unfortunately is the only carbonised version that is currently available. You could try to export again, setting the Project Rate bottom left of the Audacity window to 44 100 Hz. If this does not help, there are two alternatives:


 * Download the current version of Audacity. This needs a later version of LAME, downloadable here. Current Audacity requires OS X 10.4 or later. Users on OS X 10.3 might be able to use the legacy 1.3.3 Beta together with libmp3lame-osx-universal-3.97.zip but this is not recommended.


 * Export as AIFF or WAV from Audacity and convert the file to MP3 in iTunes. See the following section.

Alternative MP3 encoding with iTunes
Export as WAV or AIFF from Audacity, drag the file into iTunes, and convert it to MP3 in ITunes 8 as follows:


 * 1) Click iTunes > Preferences
 * 2) Click on the leftmost "General" tab
 * 3) Click the Import Settings button half way down on the right
 * 4) In the "Import Using" dropdown, choose "MP3 Encoder"
 * 5) Click OK and OK
 * 6) Control-click over the file you want to convert > "Create MP3 version"

If you have iTunes 7, the setting to change is on the small "Importing" tab inside the "Advanced" tab.

Advanced MP3 encoding with LAME in iTunes
Although iTunes uses its own MP3 encoder, not LAME, you can run the LAME MP3 encoder inside iTunes on Mac with by following the instructions half way down this page. Encoding to MP3 in iTunes using this LAME plug-in will also allow you to use variable bit rate, joint stereo and other encoding options not currently available in the 1.2.6 release of Audacity.

Obtaining LAME
Most Linux distributions have some sort of package manager that fetches software packages from the Internet in .deb or .rpm format, and installs them for you. Open that package manager, search for LAME, and install it if it is not already installed. There are detailed instructions below for installing LAME by using the Synaptic package manager on Ubuntu or Debian systems.

Obtaining LAME using Synaptic
These are detailed steps for Ubuntu 9.04 Jaunty, but should be the same for all other Debian-based distributions of Linux.


 * 1) Open the “Synaptic” software-package manager.
 * 2) *In GNOME (the default desktop environment for Ubuntu and many other systems), you can find it by clicking on the “System” menu at the top of the screen, and then choosing “Administration”.
 * 3) *In KDE (the desktop environment for Kubuntu and many other systems), there will be a similar menu accessible from the bottom-left of the screen.
 * 4) *In all desktop environments, you can open up a command-line terminal and type “gksu synaptic” or “sudo synaptic”.
 * 5) Enter your Ubuntu user password when asked for it.
 * 6) In the Synaptic window, choose “Settings”, then “Repositories”.
 * 7) In the "Ubuntu Software" tab, check the box for Software restricted by legal or copyright issues (“multiverse”), and then the Close button
 * 8) Back in the main Synaptic Window, type “lame” in the "Quick search" box
 * 9) The search results will show the packages “lame” and “libmp3lame0” at the top of the list. Mark both for installation (by double-clicking).
 * 10) Click the "Apply" button, and on “OK” to any warnings that come up.
 * 11) The LAME software will automatically download and install. Close the Synaptic window when it has finished.

Obtaining LAME using APT on the command line
Behind the scenes, Synaptic uses a program called APT. You can directly use APT to install LAME. First, open up a program such as xterm, GNOME-Terminal or Konsole, that gives you access to the command line.

Assuming that LAME is available in one of the repositories listed in /etc/apt/sources.list, you can install LAME with the following command:

sudo apt-get install lame libmp3lame0

You will be asked for your user password. LAME will then download and install.

Some Linux systems do not use sudo. In that case, enter these three commands:

su apt-get install lame libmp3lame0 exit

You will be asked for your root password.

DEBIAN Linux: LAME and "libmp3lame0"

 * 1) If you cannot find "libmp3lame0" in the repositories you need to add "debian-multimedia" to your "sources.list".
 * 2) Follow the instructions found here: http://debian-multimedia.org/ - choose a mirror if you wish.
 * 3) Remember: editing your sources.list requires ROOT privileges "sudo {your_text_editor} /etc/apt/sources.list" - make a backup!
 * 4) Once done you can use "Synaptic" or "apt-get" to install "lame" and "libmp3lame0".

LAME from source
If there isn't a LAME package for your distribution, go to the LAME Project home page and download the latest source code. Compile it as a shared object. When Audacity prompts you for it, it will be at /usr/local/lib/libmp3lame.so.

This is for advanced users. Newer users are advised to look for a LAME package for their distribution.

Setting Audacity up to use LAME

 * 1) Open Audacity and in the window click “Libraries" (this may be called "File Formats”, "Audio Files" or "Import / Export" in legacy versions of Audacity).
 * 2) In the "MP3 Export Library" section, click "Locate" then "Browse" and navigate to the location of the libmp3lame.so (shared object) file (in legacy Audacity 1.3.6 or earlier, the MP3 section and "Locate" button may be named differently; choose “Yes” if you are asked if you want to search)
 * 3) The file name should have a dot and a zero on the end: e.g. /usr/lib/libmp3lame.so.0 *
 * 4) Click "OK" on any warnings then close the Preferences window.
 * 5) When you export an MP3 file, click on "Options" in the export window in order to choose what bit rate (MP3 quality) you want (in legacy Audacity 1.3.2 and earlier, bit rate is chosen in the same Preferences window where you located the LAME library).

* in some older versions of Audacity, there had to be no “.0” on the end, and users actually had to rename the file to make it conform to this expectation.

Using LAME without Audacity
There is more to LAME than just a plug-in for Audacity. You can also just use it on the command line to encode files.

Open up a terminal, and use the cd command to navigate to a directory containing a .wav audio file. Try the following command:

lame *.wav

Replace “*” with the name of the file, or just leave it as “*” if you want to convert all .wav files in that directory.

For more help with this, type “lame --help” or “man lame”. This is also a way of checking whether lame is installed on your machine.

Crash or excessive processing time on export
If Audacity crashes or hangs when exporting MP3s, or the export takes a long time to process, the usual reason is that your chosen Project Rate (the sample rate bottom left of the Audacity screen) is very different from the sample rate of the audio track on the screen (as shown in Hz on the Track Control Panel above the mute/solo buttons). As a result, resampling has to be done while exporting, which can create problems on long tracks. Try resampling the track to your chosen Project Rate before exporting as MP3. To do this, select all the track by clicking in the Track Control Panel, then in 1.2.x or  in 1.3.x versions. If there is any silence added to the end of the track as a result of the resampling, you can select and delete it. Now when you export the MP3, the process should go smoothly and quickly. If it doesn't, there could be a number of reasons, e.g. if you have a virus scanner set to scan all created files, this will slow the process of writing the exported file considerably. The higher the bit rate you export at, the larger the file will be, so giving a greater time penalty if you enable virus scanning.

Exported MP3 invalid / will not play
Sometimes the exported MP3 may be invalid and only a few bytes in size. As a result, it will not play and give an error. This will happen in Audacity 1.3.2 and earlier, if a Project Rate is set (bottom left of the Audacity window) that is incompatible with the bit rate of the exported MP3. In 1.3.3 and later, an error dialogue prevents export at an incompatible sample rate.

To change bit rate in 1.3.2 and earlier, go to the and look for "MP3 Export Setup". The safest solution is to always set your Project Rate to 44100 Hz. Make a rule to check this before you export, because importing a file of some other sample rate may change the Project Rate to that rate. In the current Audacity 1.2.5 (Mac Intel) and 1.2.6, 44100 Hz will always be compatible with any chosen bit rate. If exporting at 16 or 24 kbps in pre-1.2.5 versions of Audacity, it's best to choose 16000 Hz sample rate, as 44100 Hz exports will fail.

Note: in current Audacity versions, LAME will automatically downsample from 44 100 Hz to a lower sample rate at 56 kbps or lower, because low bit rates may give poor quality with higher sample rates. If especially desired, any valid sample rate/bit rate combination can be enforced by using the command line exporter in the current version of Audacity (choose "external program" in "Save as type" in the Export File dialogue). Or export as WAV from Audacity, then use LAME.exe at the command line to convert to MP3.

HINT: If you want to choose specific sample rate/bit rate combinations, the following shows those permitted in the MP3 specification, and which will properly export from Audacity (with or without resampling):

MPEG-1  layer III sample frequencies (kHz):  32  48  44.1:  bit rates (kbps): 32 40 48 56 64 80 96 112 128 160 192 224 256 320

MPEG-2  layer III sample frequencies (kHz):  16  24  22.05:  bit rates (kbps): 8 16 24 32 40 48 56 64 80 96 112 128 144 160

MPEG-2.5 layer III sample frequencies (kHz):  8  12  11.025:  bit rates (kbps): 8 16 24 32 40 48 56 64 80 96 112 128 144 160

Exported MP3 plays too fast
If the MP3 plays at the wrong speed (usually too fast), then the sample rate you exported it at is unsuitable for your player application. Once again, the safe solution is to always set your Project Rate to 44100 Hz. This was a known problem with Adobe Flash Player until some way into version 9: for the file to play properly, the sample rate had to be 11025 Hz or a multiple thereof, such as 22050 Hz or 44100 Hz. This is fixed in the current Adobe Flash Player.

Exported MP3 has low volume or no sound
If you can see your exported MP3 is playing because the timer on the media player is moving, but it has no sound, make sure the sound device is not muted (in the player or in the system control panel), and make sure the correct playback device is being used (in the player preferences or in the system control panel). If this is not the problem, go back to Audacity and make sure the -....+ gain slider on the Track Control Panel (where the mute/solo buttons are) is set centrally at "Gain: 0 db". If this slider is over to left, it will reduce or kill the volume in the exported MP3.

ID3 Tags
Make sure when you use the "Edit ID3 Tags" dialogue that you complete this by pressing OK, not escaping or cancelling it. In current versions of Audacity the Edit ID3 Tags dialogue does not come up automatically when you make a subsequent MP3 export in the same session, but you can always set the ID3 tags before exporting an individual MP3 file at in Audacity 1.2.6 or  in Audacity 1.3.x.

When using, the ID3 tag editor comes up once for the batch of files which you are multiple exporting. The "Title" and "Track Number" tags will be automatically determined by the name you give to each file and the order of the exported tracks, but you can type in data for the other tags which will then apply to all the exported files in that batch.

HINT: export of ID3v2 tags is broken in legacy 1.3.0 to 1.3.2 versions of Audacity. ID3v2 tags will be exported but only readable by iTunes. To fix this, upgrade to http://audacity.sourceforge.net/download/ current Audacity].

Exported MP3 larger than imported one
If you import an MP3 file into Audacity, then after export you find it is much larger than before, this is because the bit rate you exported it at is higher than the bit rate of the original file.

Audacity defaults to 128 kbps bit rate then remembers the last used bit rate if you change it.

If you need the exported MP3 to be the same size as before:
 * 1) Find out the bit rate of the imported file by opening it in Windows Media Player and clicking, or in iTunes, right-click or control-click over the file and click . You can also use standalone programs like MediaInfo.
 * 2) In Audacity 1.2.5/6 and 1.3.0/2, go to, click the arrow in the Bit Rate list and choose the original bit rate of your imported MP3. In all later versions of Audacity, click , choose "MP3 Files" in the file types list, then click the button.

If you export a low bit rate MP3 at the same bit rate as the original you will be degrading its quality much more than if you exported it at a higher bit rate. The penalty of the higher bit rate is that the new file would be larger and that file merge tools might no longer be able to join the new MP3 to others that had the original bit rate. If you export a high bit rate MP3 at the same bit rate you are helping to minimise quality loss (but are not saving anything in file size).

All MP3 exports are lossy
Every MP3 export reduces the quality of the original file because Audacity does not edit the file directly. Instead, Audacity decompresses the MP3 upon import to lossless PCM. This does not undo the audio losses caused by the original MP3 compression, but it enables more complex edits such as equalisation and other signal filtering to be made.

Having been decompressed, the MP3 therefore has to be re-encoded as a new compressed MP3 when exporting. The lower the bit rate exported at, the more quality will be lost with that re-encoding.

If you only want to do simple cut, copy, paste, fade and volume edits to your MP3 files, you can do so without audio losses in other tools that can edit MP3 directly without decompressing and re-encoding. Examples are:


 * MP3DirectCut for Windows (this can also be run on Linux under WINE)
 * Audion for OS X
 * Macsome for OS X
 * mp3splt - Cross-Platform tool for splitting MP3 and OGG files. Direct Windows and Mac download links:
 * Windows: interface version or command-line version
 * Mac packages: MacPorts interface or command-line, Fink interface or command-line


 * mp3wrap - Cross-Platform command-line only tool for joining MP3 files.

MP3 files of the same bit rate, sample rate, number of channels and stereo encoding mode can be typically be joined non-destructively with any of the above tools without the need for lossy re-encoding.