Talk:MP3

From Audacity Wiki
Jump to: navigation, search

Remnants of old Lame Installation archived here in case we need it

Gale has suggested archiving this material before we deprecate Lame Installation as we may need some of the material here. If anything it is likely to be the Linux material.
  • The Windows and Mac stuff should be ok now and will be better once 2.1.3 is relleased and we can link to the restructured Manual
  • The Legal issues is already fully transferred to this page
  • The Troubleshooting section is already fully transferred to this page (but may be better in Manual>FAQ - to be decided)

Contents

Peter 2May14: This page is a potential candidate for deprecation, the material is, or should be, handled more than adequately in the Manual. There may be useful additional information here that could usefully be transferred to the Manual. We may wish to consider leaving it here.
  • Gale 17Jun14: This page can be deleted and a redirect to MP3 left behind when material from it has been transferred to MP3.
  • Peter 17Jun14: But note there are links to this page from the Manual installtion pages here for MAC and here for Linux.
    • Peter 07Jan17: I removed the link on the Mac installation page in the Manual (alpha 2.1.3) as the MAnual is now superior to this page in this respect.
    • Peter 07Jan17: I dealt with the Linux page too.
  • Peter 02Oct14: I decided to leave this page here for now (I removed the Ps) as it is still referenced from those two places in the Manual (which implies that the MAC and Linux info here is richer than that in the Manual) - and there are probably many references in the Forum.

    ToDo-2 Placeholder to retain focus - we may yet decide to delete this page in favor of the Manual content.

  • Peter 07Jan17: ToDo-1 I would really like to deprecate this page once we have released 2.1.3. We have spent some time recently working on improving the material in this in the Manual - to the extent that I now believe the Manual has superior information. I don't really want to continue with parallel documentation to maintain on this in two different places (that goes against our normal policy which seeks single-source documentation).
    • If we decide to retain this page then I would certainly link to the Mac>LAME Installation and Windows>LAME Installation in the Manual - and probably similar for the Linux section (but I am not qualified to judge that, so would need advice regarding this). The "issues" section should really be dealt with in the Manual>FAQs if they are not already.
    • Note that very few pages link to here from within the Wiki now . There may be a case for a stub page to deal with any old links from Forum threads.
    • Gale 07Jan17: I suggest removing links to this page (or adjust them to point to MP3), then cut and paste the entire content of this page into an ednote in MP3 so we can see if anything wants integrating into that page. Then change this page content to be a custom redirect in an advice note with a link to MP3. After 2.1.3 is released, add a link to the advice note pointing to the Manual.
Because of patent considerations, Audacity cannot ship with a built-in encoder to export MP3 files, but is able to use the third-party LAME encoder. This page explains how to download and install the correct LAME encoder for your system, and outlines the legal issues surrounding LAME encoding patents.

Windows Instructions

New or inexperienced users are recommended to follow the easy steps in the Simple Installation section and skip the "Advanced options for MP3 encoding" section that follows "Simple Installation".

Simple Installation

Try it

Try exporting an MP3 straight away Audacity 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 File > Export, then in the Export File dialog, 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" dialog. If that occurs, press "Cancel" and proceed as per the following "All users" section.

All users

See http://manual.audacityteam.org/o/man/faq_installation_and_plug_ins.html#lame .

After installation of lame_enc.dll, click File > Export..., 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. 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).

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 dialog box.

Advanced options for MP3 encoding

The advanced encoding options are accessible in the "Options" button when you export as MP3, as described above. The 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 Joint Stereo).

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 dialog, 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 here . 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"


Mac Instructions

Downloading and installing

Left-click the below links, do not control-click

OS X 10.4 or later, Intel or PPC Mac:

Lame_Library_v3.98.2_for_Audacity_on_OSX.zip

  1. Use the current Audacity and download Lame Library v3.98.2_for Audacity on OSX.zip
  2. When you have finished downloading, use an expander such as Stuffit or Springy to extract the files
  3. Save the file "libmp3lame.dylib" anywhere on your computer
  4. Click Audacity > Preferences then the File Formats tab
  5. Look for the MP3 Export section
  6. Click the "Find Library" button
  7. Click "Browse")
  8. In the dialog box, navigate to the folder where you put the unstuffed "libmp3lame.dylib" file earlier, and select it.
  9. Click Open, then OK

Lame Library v3.98.2 for Audacity.dmg

  1. Use the current Audacity and download Lame Library v3.98.2 for Audacity.dmg
  2. 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).
  3. Double-click "Lame Library v3.98.2 for Audacity.pkg". This will install the LAME binary "libmp3lame.dylib" in /usr/local/lib/audacity
  4. If Audacity asks where the MP3 encoding library is when you export as MP3:
    1. Click Audacity > Preferences then the Libraries tab ## Look for the MP3 Export section
    2. Click the "Find Library" button
    3. Click "Browse"
    4. In the dialog box, navigate to /usr/local/lib/audacity, and select "libmp3lame.dylib"
    5. Click Open, then OK

Setting bit rate and other options

Click File > Export, 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).

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 dialog box.

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. Click on the file you want to convert
  7. Use File > Convert > Create MP3 version

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 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.


GNU/Linux/Unix instructions

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.
    • 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”.
    • 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.
    • In all desktop environments, you can open up a command-line terminal and type “gksu synaptic” or “sudo synaptic”.
  2. Enter your Ubuntu user password when asked for it.
  3. In the Synaptic window, choose “Settings”, then “Repositories”.
  4. In the "Ubuntu Software" tab, check the box for Software restricted by legal or copyright issues (“multiverse”), and then the Close button
  5. Back in the main Synaptic Window, type “lame” in the "Quick search" box
  6. The search results will show the packages “lame” and “libmp3lame0” at the top of the list. Mark both for installation (by double-clicking).
  7. Click the "Apply" button, and on “OK” to any warnings that come up.
  8. 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 Edit > Preferences 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
  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.

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.

Personal tools

Donate securely by PayPal, using your credit card or PayPal account!