Recording Your Own Audio

Recording Your Own Audio

So you're an amateur musician with a few songs you want to record, and you're not sure you want to spend $50 an hour on studio time. But you do have a guitar, a microphone, and a little mixing board. You're ready to record onto your computer but how? Well, assuming you have the output of the mixer attached to your soundcard, here's how:

$ rec mysong.wav
Send break (control-c) to end recording

It's that simple. rec is part of the SOX package, which I discuss in the upcoming section, Converting Between File Formats. The command line explains itself ”it records audio data into the file mysong.wav, in WAV format. rec knows what format to use by looking at the file extension. If you provide a -t -type option, it will use that type instead. When you're done playing, press Control-C to finish writing the file.

To play back the file, simply type:

$ play mysong.wav

play is also part of the SOX package, the complement to rec. But when mysong.wav plays back, it sounds terrible! What went wrong? Let's try a different playback tool, one that displays some information about the file:

$ wavp mysong.wav
WavTools 1.3 Written by Colin Ligertwood.
This software is provided as is. No warranty is offered, implied, or included.
Playing [FILE: mysong.wav] [LENGTH: 987494]
[RATE: 8000] [BPS: 8000] [DEPTH: 8] [CHANNELS: 1]
[TIME: 00:00:00]

The ubiqituous file command will also work:

$ file mysong.wav
mysong.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 8 bit, mono 8000 Hz

Aha! The rate is 8000 (samples per second), the depth is 8 (bits), and the number of channels is 1 (mono). This is definitely not CD-quality sound! We will need to provide options to rec to specify the appropriate values:

$ rec -r44100 -c2 -sw mysong.wav
Send break (control-c) to end recording

The file sounds much better now. As usual, consult the SOX man page for more information about the available options.

rec can do only the simplest kind of one-track audio recording. If you want to do professional quality multitrack recording, well, Linux can help you with that, too! The next chapter, Music Production, has a section about multitrack hard disk recorders that are available for our favorite operating system. These applications are quite a bit more sophisticated and allow you to lay down a number of tracks and then play them back while simultaneously recording an additional track.

 



Multitool Linux. Practical Uses for Open Source Software
Multitool Linux: Practical Uses for Open Source Software
ISBN: 0201734206
EAN: 2147483647
Year: 2002
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net