Audacity is a no cost, open source program for editing audio recordings. It runs on many platforms, but for the sake of this article, the Linux® version is considered. A powerful program with many options, Audacity is GUI-based. It enables you to record sounds of all kinds. Figure 1 shows a screenshot. Sounds can be displayed in multiple parallel tracks and you can cut, copy, and paste timed portions of the sound data. You can even add special sound effects before saving the audio data in common formats.
Figure 1. The Audacity sound-editing program
Audacity also features a built-in programming environment called Nyquist LISP that affords the skilled user the ability to create custom filters and generators that open endless possibilities for audio creation and editing.
As personal computers have grown in power per dollar, and offer extensive multimedia capabilities with professional-grade audio and video hardware, it was inevitable that creative programmers would see the need for good audio-editing software to fill that need. With the widespread adoption of personal audio devices such as MP3 players — Apple iPod, Zune®, Sansas — and mobile phones with equivalent entertainment capabilities, there are quite literally millions of people who want good audio-quality files in the forms of MP3s, custom ring tones, and podcasts. Audacity enables many of them to create and edit these customized audio files for themselves and others.
Audacity has many features to enable sound manipulation. Here are some commonly used functionalities:
- MP3 recording
If you like to have total control over your audio files, the MP3 format, in which Audacity can save files, offers great control over which devices you can put your music on, whether you want a CD or files right on your iPod.
- Ring tones
You can also use Audacity to create mobile phone ring tones. The recommended length for a ring tone is about 20 seconds, and to sound good, be sure your ring tones are loop-able, meaning that the end fits to the beginning. (Audacity allows looped playback so you can hear how the finished product will sound while you're editing.) Because ring tones come in many formats consult your phone's owner's manual to see which format you need. Most use the MP3 or WAV file format, and Audacity supports both. You can use the compressor tool to make the highs and lows a little closer so that the sound is good even from a tiny phone speaker.
- Podcast creation
For better or worse, many people want to share what's on their mind with the world. Audacity makes the creation of such podcasts a simple process; you just need a microphone, a sound card, and something interesting to say. Simply start Audacity and click RECORD.
Mixing sound effects and other elements is easy. For example, say you want to add BANG.WAV after you make a particularly important point. Click FILE-IMPORT, and then browse to your BANG.WAV file and import it. BANG.WAV will appear on its own track. You simply slide it where you want it. Audacity can handle a large number of independent tracks and long recordings, allowing you to mix a complex program. Of course, finding an Internet host to carry your masterpiece is up to you.
- Digital backups of vinyl and cassette recordings
If you own a vinyl record collection, the odds are good you have your own turntable and equipment. Connect them to your computer through the sound card, click RECORD on Audacity's interface, and start playing the songs you want to record. This functionality holds true for cassette recordings as well. Many good websites offer help if you are unsure how to do this, and the Resources section provides the links to some of them.
There are two ways you can obtain Audacity. You can download, compile, and install the Audacity source code yourself, or use your distribution's method of installing new software. Audacity is available in most popular Linux distributions.
To download the source code for audacity, use the SourceForge link provided in Resources, and choose the compressed archive file described there. It will have a name similar to audacity-minsrc-1.3.xx.tar.gz, and it should be downloaded to your Download directory. Next, open an xterm window, extract the file to your source directory, and build Audacity from the source code:
$ cd src $ tar -zxvpf ~/Download/audacity-minsrc-1.3.xx.tar.gz
This command creates the Audacity source directory for the version you downloaded and puts all of the source modules into it. After that, you're ready to configure, compile, and install as follows:
$ cd audacity-src-1.3.xx $ ./configure
If your computer is missing any development header files, for example, the
wxWidgets development libraries, it's easy to
fix. Assuming your distribution is Debian based (like Ubuntu) simply open
the Synaptic Package Manager and search for the missing library. Make sure
you install the found library files with names ending in the -dev suffix.
Then, run the configure script again as above. You may need to repeat this
process as more dependencies are discovered. (The included README text
file also has helpful information for configuring the build
Assuming that the configure stage has worked and no errors have been found,
you're now ready to run
make to compile and
$ make $ sudo make install
As a developer, you will recognize these steps as the normal procedure to configure, compile, and install most applications from source code. If, however, you had any problems along the way, the next best thing is to use your distribution's package manager update tool to install Audacity.
If you are a Linux user, your favorite distribution's updating mechanism
can download and install Audacity for you, which is a lot easier than
wrestling with building it yourself. For example, distributions that are
Debian based allow you to obtain the latest production version with the
apt-get command as follows:
$ sudo apt-get install audacity
A great advantage of using this mechanism to install Audacity is from the time you do so, whenever updates become available, they will automatically update when the system does its normal updating. An alternative to waiting for the next update is to start it for yourself, like this:
$ sudo apt-get update
This way, you can keep up to date with the latest stable release of Audacity.
You customize Audacity by adding and using audio filters. The filters are actually open source program code written in LISP, one of the first programming languages ever created. The version of LISP used in Audacity is called Nyquist LISP, a version customized specifically for working with audio data. Nyquist LISP is powerful, efficient, and extensible, providing you with a good set of predefined data structures that represent various parametric aspects of the audio stream. However, you don't have to be a LISP expert to use the filters than come built in with Audacity.
Audio filters are the featured tools of Audacity that enable you to alter the playback of your audio files. With these tools, you can make some portions of the track louder or quieter than other portions. You can add fading effects, where the audio track gradually gets louder or quieter, or you can add special sound effects of all kinds.
Special audio effects can include changing the pitch, the level, the speed of audio playback, and more. Combine these with their associated customized parameters and there are countless changes that you can make to your audio streams. You can make changes to affect the listener's mood, add a comic or dramatic effect to the sound, or just simply adjust the audio track until it has just the sound you want.
It's surprisingly easy to use the filters that come with Audacity. Suppose you open a track of MP3 data, and somewhere in the middle of that track you want to have the data "filtered" in a special way, perhaps adding an echoing sound effect to it. All you need to do is to "mark off" the portion of the audio track you want to add the echo to by putting the mouse cursor on the track and dragging the cursor until the region of the audio track is highlighted. Letting go of the left mouse button leaves the portion highlighted. Figure 2 shows a region from the 10-second mark to the 40-second mark of the current song that is highlighted and ready to have a special effect applied to it.
Figure 2. Prepare a segment of a song for an added effect
Next, you apply the Echo filter by clicking Effect > Echo, and set the delay time and decay factor that you want in the window that appears, as shown in Figure 3.
Figure 3. Apply the Echo filter
Finally, you can preview the sound effect by clicking Preview in the Echo window, shown in Figure 4. You can play with the effect by changing the delay time, decay factor, and clicking Preview until you have the exact sound effect you want.
Figure 4. Preview the added sound effect
As mentioned, Nyquist LISP is a customized version of LISP specifically tailored for audio editing. Nyquist, which has roots in the academic community, was derived from other "functional" language experiments conducted during the past decade. Nyquist is distinguished from other LISP dialects by many specific extensions for audio editing and is maintained by a community of volunteers—most notably Professor Roger Dannenberg of Carnegie Mellon University, a co-author of Audacity.
LISP is especially good for writing audio filters in Audacity because of its brevity and conciseness. A small amount of code can have dramatic effects on the audio stream. For the specific implementation of Audacity used in this article, browse the Nyquist LISP code for some of the many built-in effects by looking at the .ny files in the nyquist and plug-ins directory under the common /usr/share/audacity directory.
You do not need to know LISP to use the built-in filters, but it's good to be aware of where the functionality of your tools comes from. The link to Nyquist LISP provided in Resources provides more examples of custom filters and greater information on the functions used.
First, decide whether to write the filter from scratch or copy and modify a filter that already exists and is similar to what you want to accomplish. Most people new to programming are best served by the latter approach. With that in mind, you're in luck: You can copy the following small snippet of Nyquist LISP code into your favorite editor and save it in the plugins directory for immediate use.
;nyquist plug-in ;version 1 ;type process ;name "Fade In by Myk" ;action "Fading In..." (mult (ramp) s)
That's it! Using your favorite editor, copy that snippet to a file called
myfadein.ny, and save the file to the
/usr/share/audacity/plugins directory. The last three lines of this
simple filter define the name that you'll see in your
Effect menu and the text seen (the "action") in the
status area when the filter is being applied; the
(mult (ramp) s) is the actual Nyquist LISP code
that causes the fading effect. Finally, stop and restart Audacity so that
it can read the new filter on startup.
To test the new filter, "mark off" the portion of the audio track that you want to add the fading effect to by putting the mouse cursor on the track, dragging the cursor until the region of the audio track is highlighted, and then releasing the mouse button to leave it highlighted. Then, apply the Fade In by Myk filter (or whatever your filter is named) by clicking Effects > Plugins 1 to 15 > Fade In by Myk. Click Play to listen.
If you choose to go deeper into the programming adventure and actually create some filters that you think others would find useful, by all means contribute them to the community and help make Audacity a more powerful tool for all. To contribute your filter code, see Resources for links to contact the community and submit your .ny file to the program maintainers.
The evolution of audio technology has brought tools that used to require an expensive studio onto the desktop computer. Audacity, with its great variety of filters, controls, and highly visual way of displaying the complex waveforms of multichannel sound, is a valuable addition to your arsenal of media editors.
- Learn more about Audacity from its team wiki.
- Be sure to check out the Audacity community forum.
- The Open source
developerWorks zone provides a wealth of information on open
source tools and using open source technologies.
- Visit the Safari bookstore e-reference library to find specific technical
- Follow developerWorks on Twitter.
- To listen to interesting interviews and
discussions for software developers, check out developerWorks podcasts.
- Stay current with developerWorks technical events and webcasts.
Get products and technologies
- Learn more about
and download Audacity from
- Learn more about
- Innovate your
next open source development project with IBM trial
software, available for download or on DVD.
Myk Zimmerly loves living the minimalist life style, but his two technological passions are music and computers. Moscow Mills, Missouri, is home, and the fresh air and freedom of rural living inspire Myk to no end. You can reach Myk at firstname.lastname@example.org.