Podcasting with Linux Command Line Tools and Audacity

November 2007


Recording a good podcast is as much about good voice training and delivery, as much as it is about the technology used to record it. As with other things, you only get better with practice.

In this article we will use Linux command line tools and optionally Audacity to create a quick, no-frills podcast with a background music track. The only other GUI-based tool we will manipulate, will be the ALSA Mixer. The mixer has a command-line interface too, but the GUI is intuitive and quicker. The emphasis is on quick turnaround.

If you are the type that attaches a quick voice message to an e-mail for impact, ("We simply must get this done by Friday!!") then the podcast creation method outlined here should appeal to you.

If you are new to podcasting and audio mixer setups, the next few sections might be tedious. But towards the end of this article, we will see how quickly one can run down these steps so that you spend more time recording your message than wrestling with technology or complicated screens.

The Recording Setup

A stereo headset with a microphone works best for making or listening to podcasts; but do not despair if you have a desktop microphone and a pair of speakers. You can always upgrade your setup later. For now just make sure that the sound from the speakers does not directly reach the microphone and cause feedback.

Place the microphone towards the lower right of your mouth as you speak, away from your nose. This avoids breathing sounds getting captured. Minimizing ambient noise by choosing a quieter time of the day is also a good idea.

Recording Tips

All through the recording and mixing process, there are a couple of things to keep in mind.

First, stay above the noise floor. The signal should be recorded high enough to stay above the background noise and hiss. If your audio signals are like little, beautiful flowers growing in a grassy field, make sure their stalks are tall enough to tower over the field. Else you would lose the flowers in the prickly grass just as your audio signal would be lost in the background hiss and noise.

Second, stay below the clipping or overload level of the audio channels. If your audio channels were like open water canals, then overloading them past the clipping limit would have a similar undesirable effect on your audio experience as a canal overflowing its banks -- puddles around your feet or a jarring quality to your sound.

Since sound level is a dynamic quantity, record your audio at a level of around 80% keeping some margin (or headroom) against clipping.

Setting up the Audio Mixer Connections

An audio mixer application helps us record our podcast by allowing us to mix various signal sources in the right proportion. You can bring up the sound mixer from the Linux start menu by getting into the Sound and Video category.

To those who are new to the red and green lights of the Linux ALSA mixer, let us run a quick intro. There are audio signal sources and there are destinations. An audio mixer allows you to route one or more sources after adjusting their relative levels to one or more destinations and achieve your project goal. The project goal might be listening to music -- the destination in this case being a pair of headphones or speakers; or it might be a recording device, say, to capture a podcast as we will do presently.

  1. Once the ALSA mixer or Kmix is up, select the Output tab. Make sure the Master output channel as well as the PCM channel is switched on (click over the green lights so they turn on) and their gains -- the slider positions -- are at the maximum.
    Podcasting with Linux Command Line Tools and Audacity
  2. Briefly, go the Switches tab and click over the LED indicator to switch on the 'Mix Mono'. We will use this mixing switch to mix the microphone (voice) and the CD (background score) signals to both the monitoring and the recording channels. You can optionally select the 'Mic Boost' switch but experiment with your microphone to check if you indeed need it.
    Podcasting with Linux Command Line Tools and Audacity
  3. Now, go to the Input tab. The two input sources that interest us are the 'Mic' or microphone for our voice and the CD for our background music score. We need to mix these two signal sources in the right proportion and deliver them to the Capture device. Turn on the green LEDs for the 'Mic' and 'CD' sources ensuring that their outputs feed into the 'Mono Mix' and also to your monitoring headphones or speakers. That way you get to listen to what is being recorded. All other input sources should be off (their corresponding green LEDs should be off).
    Podcasting with Linux Command Line Tools and Audacity
  4. Lastly, turn on the red LED under the Capture slider on the Input tab ensuring that the 'Mix Mono' output gets connected to the recording channel.

In the last four steps we ensured that: our monitoring headphone/speaker outputs are switched on and are at full gain; the mono mixdown output is connected to the monitoring headphone/speaker; the two audio sources of interest to us -- the Mic and the CD -- are connected to the input of the 'Mix Mono' and also to the monitor; and lastly that the Capture channel is connected to the 'Mix Mono' output to be able to record a mono sound track.

We have correctly set up our Audio Mixer switches for our podcast project. Time to take this for a spin and check the audio levels. Whisper into your microphone and verify that you can hear it through the monitoring speakers.
Play an audio CD and speak into the microphone as the CD plays. You should be able to hear your voice as well as the CD audio through your monitor. Keep the CD playing.

Setting the Recording Levels

Now that our Audio Mixer is correctly set up to record our podcast and we have also verified our connections, it is time to set recording levels. The three sliders that we will play with, are all on the Input tab of the mixer: Mic, CD, and Capture. To start with, set the CD slider at about 20%, the Mic slider at around 80% and the Capture slider at around 50%.

Run the following command in a console:

$ arecord -vv /dev/null

You should see a scrolling list of horizontal bars that indicate the audio level of your audio mix. Switch off the 'Mic' input (remember the green LED) and adjust the CD slider so that audio level meter shows between 20% and 30%.
Next, switch on the 'Mic' input in the mixer and speak into the microphone in your typical podcast voice. Adjust the 'Mic' slider so the audio level meter now records between 80% and 100%. Adjust the 'Mic' and 'CD' levels so that their relative levels sound right on the monitor and adjust the Capture slider to keep the audio level between 80% and 100%. This will require a few passes before it comes out right.

Finally, Recording

Cue your CD to the right track and get ready with your podcast script if you have one.

Issue the following command:

$ arecord -vv -c 1 -f S16_LE -r24000 testpodcast.wav

Briefly, in order of the options, arecord displays the scrolling level meter, sets up one recording channel with an audio sample rate of 24KHz at 16 bits per sample, and records the audio into a file named testpodcast.wav. You can try different sampling rates and sample sizes as you get more proficient.

Immediately, start playing the CD track and voicing your podcast, in that order. After you have finished voicing your podcast, hit <Ctrl><C> to stop arecord. To test your podcast type:

$ aplay testpodcast.wav

Satisfied with the results? Perhaps the background is too loud (reduce the CD gain) or the podcast appears jarring in parts (reduce the Capture gain and/or the Mic gain). Record a few more test podcasts in this manner to calibrate your own voice level and also to get the right mix. Then go for the final take.

Now that you have your mixer levels and switches set correctly, it makes ample sense to save the setting. Which means, once you get your settings right, you do not have to spend time again to fiddle with those sliders except for minor adjustments. To store your mixer settings, type:

$ sudo alsactl store

To restore the setting for your next podcast recording, just type:

$ sudo alsactl restore

You can also save the settings to named files with the '-f <filename>' option and restore those named settings; maybe a different stored setting for each podcast flavor.


This is an optional step. Post-processing is not usually needed for a no-frills podcast after you have had some practice with recording levels and mastered the ability to smartly start and stop recording.

Post-processing of a podcast in our context does not materially improve its quality. It is mostly a finishing step meant to package the podcast and add any effects. For example, if your audio is too close to the noise floor, or if your recording is already clipped, there is very little that post-processing can do other than mitigate some of the aural discomfort for a price.

What post-processing can do, however, is normalize your audio track, trim the beginning and end of your audio track to remove awkward silences, silence ambient background noise when there is no audio present for noticeable durations, or gracefully fade-in and fade-out your audio track. There are interesting effects possible, but overuse them and they become a distraction.

We will use Audacity for post processing and briefly outline the steps involved. If you are new to Audacity, there are excellent tutorials available at http://audacity.sourceforge.net.

Let us quickly go through the post-processing steps. It is a good idea to work with a copy of your original recording. Audacity offers Undo capability under the Edit menu. However, stick with a particular post-processing step until you get it right to your satisfaction before you go to the next.

Normalization: Read in your track (the .wav file) into Audacity. Select the entire track and from the Effect menu, choose Normalize. This step scales your entire track so that the peak amplitude stays at the clipping level or just below it. Remember that if your recording is too low or already clipped, there is very little normalization can do to mitigate that.

Trimming: Delete the unwanted sections from the leading and trailing end of your recording. In Audacity, just select the portion of the track you want removed and use Delete from the Edit menu. You can similarly delete long silences.

Fading-In and Fading-Out: This is to let your audio level rise and fall gradually and gracefully. Select the section of audio you want to fade-in or fade-out. Normally, you fade-in the leading part of your audio and fade-out the trailing part.

Now, play your audio track and verify that it sounds the way you expect it to. Save the wav file. You can directly export your podcast track to MP3 or Ogg Vorbis right from within Audacity. In case you decide to skip the post processing step, use sox to convert your podcast. You can also use sox for post-processing but the interface is a little daunting, for beginners at least.

To convert your podcast to MP3 type:

$ sox mypodcast.wav mypodcast.mp3

or, to convert it to Ogg Vorbis type:

$ sox mypodcast.wav mypodcast.ogg

Your podcast is done and ready to be served.

Quick Rundown

If that sounded tedious, this is how easy it gets after you get some practice. Assuming that you have your background score and podcast matter ready, this is how you go:

  • Bring up ALSA Mixer. Restore your stored setting.
    $ alasctl -f <file with saved state> restore
  • Cue your CD (background score) to the right track and get your podcast script ready.
  • Start the recording by issuing the appropriate 'arecord' command.
    $ arecord -vv -c 1 -f S16_LE -r24000 testpodcast.wav
  • Play the CD (for your background score) and start voicing your podcast, in that order.
  • After you have finished voicing your podcast, stop the CD and then stop 'arecord', again in that specific order.
  • Run post processing if necessary.
  • Convert the podcast to your favorite format.
    $ sox mypodcast.wav mypodcast.ogg    ## or mypodcast.mp3

If you are new to podcasting, I hope we have demystified things enough for you to create your first podcast. If you are a podcasting pro, perhaps the approach outlined here helps when you want that extra quick turnaround.

You've been reading an excerpt of:

Linux Thin Client Networks Design and Deployment

Explore Title