# Exporting to an External Program

### From Audacity Manual

This sends audio via a command-line to an external application, either for processing or for encoding as a file. For example, this is a way to export to the LAME MP3 encoder with additional parameters not supported in the MP3 Export Options interface. It could also be used to export to an alternative MP3 encoder, or to a format not supported by Audacity.

  Accessed by: File > Export..., then in the File Export Dialog, choose (external program) and click Options

## Specify Command Line Encoder

From the File Export Dialog, choose the file name and extension, select (external program) in the "Save as" box, then click the Options button.

## Command Line Export Setup

- Command: Type:

1. The path to the program
2. Space and the infile command (if the program syntax requires these)
3. Space, hyphen, space
4. Valid output options for the program
5. Finally (assuming file output) space and "%f".

The "%f" command passes the file name and extension entered in the File Export Dialog as the output file of the external program. Two default commands are provided, lame - "%f" and ffmpeg -i "%f".

If you are exporting to MP3 with LAME, there is a complete list of commands on the usage page. For example, the default LAME command:

    lame  -  "%f"

creates a 64 kbps (mono) or 128 kbps (stereo) constant bit rate MP3 at quality level "3". The command string:

    lame - -v -b 112 -c -p "%f"

produces a variable bit rate MP3 of minimum 112 kbps bit rate, with a copyright marker and CRC error checking enabled.

If exporting using FFmpeg, you can view the FFmpeg command-line usage in the FFmpeg documentation.

On Windows or Linux, you can access the LAME or FFmpeg command-line program with just the "lame" or "ffmpeg" command, providing LAME or FFmpeg are installed in the standard location. On Windows, this requires that you used the LAME or FFmpeg .exe installer and did not change the installation directory. Otherwise, the full path to the command-line program must be given, and must be enclosed inside quotes if there are any spaces in the path. Here is an example of a command to FFmpeg in an arbitrary location forcing the exported codec to a 256 kbps mp2:

    "E:\FFmpeg for Audacity\ffmpeg.exe" -i - -acodec mp2 -ab 256000 "%f"

The "Command" box holds up to the last 12 items entered. When a thirteenth command is entered, the first one (at the bottom of the list) is removed.

- Browse...: Opens a "Find path to command" window where you can select the command-line program you want to use. Clicking "Open" will then enter the path to that program in the "Command:" box, ready for you to add the commands and "%f" after the path.

- Show output: If checked, a Command Output window in Audacity will display a success or failure message from the external program. If unchecked, the window will only appear in the case of an error message.

Note: The Metadata Editor does not pop up before command-line exports, nor are any tags it already contains passed to the external program. Use the appropriate command for your program to write metadata to the output file.

##### Views

##### Help Location

- Local manual in use
- Internet manual