Recording Audio with PCLinuxOS

by Paul Evans - Gemlog

Our primary mission is to learn how to 'rip' cassette tapes to a hard drive. That is, to copy audio cassette tapes into convenient files that we can play back with any of the popular music players distributed with PCLinuxOS. In fact, we'll be able to record any audio signal we can lay our hands on, including broadcast radio by the time we're done.

Being lazy Linux users, the first thing we do is a quick Google search to see what's out there to help us. Even before posting to the forums, or perhaps especially before posting to the forums, just have a quick Google for the answer. Google has a special way to find help for topics about Linux. Searching http://www.google.com/linux instead of the regular website, it will show results about Linux only.

Sure enough, searches on 'audio cassettes' and 'audio tape' quickly turn up several excellent articles, all mostly saying the same things and quite often using one of my favorite audio tools: Audacity. There are some links to the more interesting ones at the end of this article.

Will It Be Dangerous?

RELAX! There's nothing quite like having someone scream the word 'relax' in your face to invoke a sense of calm and serenity, is there? Our primary mission presents no danger at all; we'll be marching along well-trodden paths tramped smooth long ago by, well, old Linux path trampers. Towards the very end of our mission, we may wander off the trail a little in search of a bit of excitement, but I promise there will be no Command Lines Of Unusual Size - or any more "Princess Bride" references. Probably.

What To Pack

We could do the basics straight from a PCLinuxOS Live CD and save the files to, say, a USB key, but it will be simplest to use a real hard drive install and avoid any hassle at all. That's the plan followed here.

The first thing we need is a cassette player with an output jack on it. Nearly anything will do, so long as it has something labeled as 'Line Out', 'Phones', 'Headphones' or similar. Anything to get the sound out of it on some wires with a plug on the end. We won't even think of putting a microphone near the speakers of the tape player and doing it that way. That would only sound nasty on playback. Nasty.

The final item we need to add to our kit is the actual piece of wire to connect the tape player to our sound card in the computer. This is the tricky bit. Both ends of the wire will likely need to have a male end. Or possibly, two different styles of ends. One end will almost certainly look like the jack shown above, which looks just like the end of the speaker wire that goes into your computer sound card. The other end may be the same, or it may need an end similar to some combination of those shown in the other illustration, depending on the tape player.

Notice the two little black stripes on the mini-phono plug? Those are actually important, as we won't get stereo sound if there is only one stripe, only mono sound. Worse, that mono audio may all be on one side during the playback. Any of these patch cords are easy to find in the shops and shouldn't cost more than a good cup of coffee downtown.

Sally Forth

Have you ever been in a club waiting for the band to start up? Of course you have. Did you ever notice the guy behind the sound board pretending to ignore the rest of the world whilst grandly pronouncing such memorable phrases as "Check! Check One! Two!" and "Test!"? Did you ever imagine what a genius he must be for keeping that incredible snake's nest of wires straight?

O.K., well then, that's where you messed up in your appraisal of him. About the only knowledge needed to hook-up that entire mess of audio cables is 'Outs go to Ins' and vice versa. There are a few other considerations to be sure, but that is the single most important part of his wiring job. 'Pre-amp Out' goes to 'Pre-amp In', 'Line Out' goes to 'Line In' and so on. We only need the last one.

Simply locate the 'Line Out' on the tape deck and plug it into the 'Line In' on the computer. The computer side is always labeled as 'Line' or 'Line In'. The tape deck side may try to be tricky and label itself as 'Phones', etc, as mentioned above, but we won't be fooled. It's an 'Out' and we will connect it to an 'In'. This can be done with either or both devices powered up and it won't hurt anything. No fear.

The Good Part

Before we begin recording, these two points from the Audacity website are worth noting:

  • Do not plug stereo equipment into your computer's "Microphone" port, which is designed for low-powered ("mic-level") signals only. Use the "Line In" port instead.
  • Do not connect a turntable directly to your computer. The signal from a turntable is distorted; it must be corrected by passing it through a phono pre-amp or a receiver with a "phono" input.

Now we're good to go!

Audacity is our weapon of choice since it is, a) wonderful, and b) included in PCLinuxOS. You can easily find it in the K-Menu under Multimedia > Sound > Audacity. The Audacity program is part of the PCLinuxOS base install and we won't need to install anything extra at all for basic functionality. Audacity lets us record sound from the tape player (or anything else connected to 'Line In'), clean it up in various ways, and then save it to a file on our hard-drive. It's really easy to use and we can do some cool things with it too.

First, let's make sure we are getting good signal in to the computer from the tape deck. We can mess with levels a bit and get a feel for the game itself. With everything connected, set the volume on the tape deck fairly low, say about a third of the way up to maximum volume. Depending on the output, it's best to be safe and not blow the input to your sound card; a line level out won't be effected, but a headphone jack will. Is the sound coming out of the computer speakers? Yes? Great - we're home free!

What, no sound? Don't worry, it's likely just a mixer setting. Let's go play with that for a bit.

If you don't have a little speaker icon near the clock in the lower right-hand corner of the screen, visit the K-menu and choose Multimedia -> Sound -> Sound Mixer (Kmix). Now, click on the speaker icon near the clock. A small window will pop up showing a volume control and a button at the bottom labeled 'Mixer'.

Make sure the LED at the top is bright green - that's the mute button. Click on the mixer button once and a different, more complicated window will open up.

This window has 3 tabs: Output, Input, and Switches. Click on the Input tab. The little green fake LEDs at the top mean that the thing is turned 'On' for sending to Output. The fake red LED's at the bottom select which Input is used for recording stuff. Try to set the levels between 50 and 75%, now choose the Output tab and do the same thing.

At this point you really should have some sound. If not, things you can check for are a physical switch and/or volume on your speakers, loose or unplugged cable (duh) or an output switch on the tape deck, if it is that sophisticated. Beyond those causes, please visit our forums: you're off this mission for now.

Now we have that sorted, let's do the fun stuff! Go to your K-menu and run Audacity from: Multimedia > Sound. You'll see a window like that shown above after you choose the language setting. It looks a little intimidating, but the things we care about first are those we already know best: the VCR/DVD style buttons at the top left, the large, colored, friendly looking ones. They work just as expected.

Just press 'Play' on the tape deck and click the round, red, 'Record' button in Audacity. Two rows of wave forms should appear in the Audacity window as the recording proceeds. If the two rows of wave forms do not appear as shown below then check back over the cables and settings as above.

Click on the square, brown, 'Stop' button in Audacity and stop the tape deck after either letting the tape play to the end or after just one or two songs. In fact, any amount of sound recorded this first time out is fine, even just a few seconds worth of it. At this point, the sound is recorded onto the hard-drive, but only as temporary files. There are two, somewhat confusing options under the 'File' menu for saving files permanently. 'Save Project' will save all the raw sound data as Audacity project files. These files are no good for burning to a CD or sending to an mp3 player, but it lets us keep all our options open for further editing or effects. It's a good idea to save the recording as a project, especially if it's a long session.

The 'Export' option is the one we need for creating the more familiar '.ogg' or '.mp3' files that we probably want to end up with. Briefly, the 'Wave' option should be chosen for creating regular audio CDs for when we later use the K3B CD burner program included with PCLinuxOS. We can also use 'Ogg Vorbis' or 'MP3' for use with USB keys, MP3 players, or very recent car audio systems.

Wave and FLAC files contain all the original audio information from the recording. FLAC files are much smaller than wave files, but not too common yet. Ogg and MP3 files are the smallest in size, but that small size is achieved by actually throwing away some information. These are known as 'lossy' file formats and is the reason why we want to keep the original recording session around as Audacity project files until we are sure that we have the final version as Ogg or MP3. The Ogg format is both open-source and superior to the proprietary MP3 format and should be preferred where possible.

The first time a file is exported as an MP3 a dialog will pop up explaining the need for libLAME. Just let it go ahead and locate it on the hard-drive. This will only happen the very first time. If Audacity complains that it can't be found, just go to Synaptic and make sure the the Multimedia Meta Package is installed and try again and then it will work.

Now, just mess around and have some fun. There are a lot of toys in Audacity. Just use the 'I beam' cursor (the default) to select portions of audio and then tell Audacity to do Something Interesting to it. For example, if there's a bit too much silence at the beginning or end you can snip it off. Or perhaps it would be nice if it faded out at the end - or faded up at the start? Just explore the menus and experiment. There is no way to make the smoke come out of your computer, no matter what you do within Audacity:

  • Filter out hiss or rumble (High or Low filtering)
  • Fade in or out
  • Add some echo
  • Create fake stereo or remove vocals
  • Lots more, check out the tutorials listed below

One of the nice things about Ogg and MP3 files is that they contain the name of the artist, album, genre, year and much else instead of the boring Track 1, Track 2, etc. that the RIAA gifted us with. Under the Audacity 'File' menu is an entry named 'Open Metadata Editor.' Pick that and then just fill in the blanks pretty much. Choose 'ID3v1' when it asks - the other one doesn't work with all playback programs or devices yet, but it is selected by default.

This point in the trail is as far as you need to go to get the job done. Have fun!

Danger? What Dang...Umph

Really, the only danger around is how addictive it can be to play with audio on Linux. There are an awful lot of programs out there, both command line and those with graphical user interfaces. Have a look at the "Loads of Linux Links" site listed in the references and you'll find dozens of programs to play with. Many of these are available in PCLinuxOS with simple clicks in Synaptic, but some would require more effort to install.

The 'Baudline' program is not listed at LOLL, but it's an over-the-top-wonderful toy for zero cost. Actually, it is meant as a serious tool for experts in fields like vibrational analysis, but if you know how to undo a tarball and click to run a program, it's worth checking out. It is only distributed as a pre-compiled, ready to run, binary and is not open source. It won't appear in your menus unless you put it there manually afterwards.

Finally, for the really adventurous (or those with a serious amount of audio work ahead) check out the Sox program, which is installable from Synaptic and included with PCLinuxOS. It's entirely command line, but extremely useful for batch conversions of files. Time shifting broadcast radio using cron jobs and converting modem voice mail files are other uses I've found for it. I'd talk more about Sox, but I'd have to break my promise about CLOUS given at the beginning.

Mission accomplished!

References

Audacity:

http://audacity.sourceforge.net/manual-1.2/index.html

Audacity Tutorials:

http://audacity.sourceforge.net/help/tutorials

Nostalgia project with Ogg Vorbis:

http://www.linux.org/lessons/beginner/l18/lesson18e.html

FLAC format:

http://flac.sourceforge.net/

Ogg Vorbis:

http://www.vorbis.com/

Loads of Linux Links:

http://loll.sourceforge.net/linux/links/Audio-Video/index.html

SoX - Sound eXchange:

http://sox.sourceforge.net/

Top