PulseAudio, Audacity and recording sound from websites
I've been looking for a way to record sounds (namely music) off websites like MySpace and Neocha, because the music that we play on our show has to be 1- indie, and 2- Chinese.
Needless to say that I couldn't play music from many of the bands that I hear on Neocha's NEXT music player, just because they happen to be obscure Chinese bands that may not have considered an international audience (some, however, have been touring the world). In fact, as far as I know, you can't download the songs even if you wanted to pay for it (don't even think about finding some of those bands on P2P networks).
I finally got to try out a solution that my friend Rob suggested. And that's the Audacity, a free open-source software for mixing and recording sounds/music. There's nothing so special about Audacity (except that it's free), but it's when you use Audacity with a sound source that's your computer's stereo mixer that it becomes interesting (see instructions).
I found out that my own computer, a Dell XPS m1210, has a sound card (a STAC92xx by Sigmatel) integrated to the motherboard (Intel). On Windows, the driver provided by Dell "C-Major Audio Driver" does _not_ let you mix stuff, and does not give you access to the output of your stereo system. I read somewhere that you could somehow replace this driver (its XP version only) by the same driver provided through LG.
Since my Windows is Vista, I rebooted into my Ubuntu (now 8.10 Intrepid Ibex) instead and looked at my options from there. Audio has always been a part of the Linux world that I neglected. I used mplayer before to save streamable videos (it's even more simple as in my entry, because you just use the "-dumpvideo" option). How about audio then?
I understand that ALSA is the mixer - your applications speak to ALSA and pass it to PulseAudio, which is the layer that redirects everything back to your sound card, aka The Hardware. Aside from recording, you can also use PulseAudio to make modifications to the output, redirect to different "sinks" (a wireless network-based sound system, anyone?).
There's a nice info page on the Ubuntu wiki. In fact, a section at the bottom ("Recording example...") was what I used to record my music. I also installed the PulseAudio Volume Control (pavucontrol), Volume Meter (pavumeter) and Device Chooser (padevchooser). The latter is a GUI that lets you choose and configure what applications output to PulseAudio and what devices on your computer (front speaker, headphones, or elsewhere?) are used to play sounds.
(PulseAudio is now the default sound server on Ubuntu, replacing Esound from previous releases.)
Following the instructions in the Ubuntu tutorial, I used padsp, a OSS wrapper, which starts an application connect to a PulseAudio server through a OSS audio device ("padsp starts the specified program and redirects its access to OSS compatible audio devices (/dev/dsp and auxiliary devices) to a PulseAudio sound server."). The command is:
padsp -d audacity
(with all the comfort of debug info...)
Then choose the OSS (/dev/dsp) device as you would on Windows with a non-restrictive sound card driver, and start recording using your system's sound output (ALSA something...). Make sure to mute the microphone, also through the PulseAudio device choose!
It's a powerful method, but may be illegal in some countries (not sure which - it's just the Ubuntu tutorial saying).
Leave a comment