Quick and dirty recording of stereo mix on a Linux box

Last night I wanted to record some things (for personal use only) coming out of the stereo mix on my Linux workstation (currently running Fedora 11 x64). In the past I've been able to use Audacity (http://audacity.sourceforge.net/) - the awesome open source and free audio editing software available for Linux, Mac, and Windows. For some reason I wasn't able to get Audacity to pick up the stereo mix as an input so I searched around to find out how I could record the stereo mix coming out of a Linux workstations soundcard. Here's what I found ...

After Googling around for about 15 minutes I came across an excellent post on the Fedora Project's wiki - https://fedoraproject.org/wiki/How_to_make_a_podcast It explained how to save the raw audio from a PulseAudio source.

Checkout the article above for full details, but here's the gist of it - you should have an associated monitor device for your soundcard via PulsaAudio. You just need to find the right audio device name and use the 'parec' utility in the pulseaudio-utils RPM package provided by the Fedora Project.

Basically install pulseaudio-utils, and paman, find your soundcard's monitor device and then run the parec command. I followed the instructions on the Fedora Project wiki page above to install the packages, found my monitor device (in my case it was 'Monitor of Internal Audio' - your's will probably differ), and then I ran the following command:


parec -r -d alsa_output.pci_8086_293e_sound_card_0.monitor > myaudio.rawau

This command will output the raw audio from your soundcard usually in 16-bit stereo at 44.1KHz sample rate.

Once the recording is finished, you just open Audacity, choose 'File --> Import --> Raw Data,' find your file, and you should see the waveform data in Audacity once it's done importing. You can then export the audio as Ogg, Wave, MP3, or your format of choice.

Remember to killall parec when you're finished recording. You don't want to fill up your hard drive do you?

Also remember, when you record you are output the entire stereo mix from your sound card, so if you have any instant messaging programs, web browsers, or terminals with bell sounds open, those will be recorded in your raw audio as well. It's best to mute any sounds in those programs you don't want in the mix.

Hope this helps someone.

Enjoy,
Flux.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.