Export with external encoder examples.

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Export with external encoder examples.

Post by steve » Sun Feb 06, 2011 1:05 pm

Audacity 1.3 is able to export through external encoders such as LAME and SoX using an option in the Export menu.
An overview of this is described in the manual http://manual.audacityteam.org/man/Expo ... al_Program

Here's the examples of Command Line export options from the Audacity manual:

Code: Select all

command  -  "%f"
The "%f" command passes the file name and extension entered in the File Export Dialog as the output file of the external program.


LAME Examples:

Code: Select all

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.


Here's some examples more examples (not in the manual):

High quality mono MP3 with LAME:

Code: Select all

lame -V 0 -a - "%f"

High compression (small file size) mono MP3 with LAME:

Code: Select all

lame -V 9 -a - "%f"
SoX Examples:

Code: Select all

sox -t wav - -t ogg "%f"
Export as an Ogg Vorbis file.

Code: Select all

sox -t wav - -t wav "%f" echo 0.8 0.3 30 0.4 reverb 60 10 15 100 10 10
Export as a WAV file with a "bathroom" reverberation effect.

Feel free to add your own recipes.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: Export with external encoder examples (Windows)

Post by Gale Andrews » Tue Feb 08, 2011 1:28 am

To just use the command on Windows (without giving a path to the encoder), you'll need to have installed the Lame or FFmpeg binaries in their default location in "Program Files" so as to create a Windows registry setting that Audacity will look for as the location of the encoder.

Here are a couple of examples with FFmpeg.

This exports a file with the codec forced to Nellymoser Asao, so for example you might want to use .flv extension for the format to export to in Audacity's "Export File" window:

Code: Select all

ffmpeg -i - -acodec nellymoser  "%f"
This exports a file forcing the file to a 256 kbps mp2, using FFmpeg from an arbitrary location of your choice (ensure the path has quotes around it if it includes spaces as it does here):

Code: Select all

"E:FFmpeg for Audacityffmpeg.exe" -i - -acodec mp2 -ab 256000 "%f"
I'd be interested to know if command-line exporting works on Mac. /src/export/ExportCL.cpp suggests the code does not work on Windows or Mac, but I expect it does.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

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

Re: Export with external encoder examples.

Post by steve » Sun Mar 06, 2011 10:55 am

Exporting U-law encoded file using SOX.

This one is from Leland and is useful for producing standard U-Law 18-byte fmt chunk files as required by many telephony applications.
http://forum.audacityteam.org/viewtopic ... 14#p132079

Code: Select all

C:...sox -t wav - -e u-law "%f"
Last edited by steve on Fri Apr 24, 2015 3:37 pm, edited 3 times in total.
Reason: fmt chunk
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply