Thursday, January 19, 2012

The best way to capture, record any sound playback in Oneiric Ubuntu Linux

The best means what the sound architecture designed to be used.  It's lossless - the same digital signal goes to your speaker and to the file.

Any means what you hear is what you get (WYHIWYG).  All you need is any sound card or USB device so you can hear anything.

The problem of Ubuntu forums is that the information isn't update and the obsolete post pull you into it like a magnet. 

In Oneiric, the sound architecture is ALSA and the sound server is Pulseaudio.  I have no clue what it means, but simple things become complicated and many info are obsolete.

Oneiric is bundled with the command pavucontrol, and it has no manual page for it, brilliant.  You can find PulseAudio Volume Control in the dash, or just enter the command in a terminal. It has GUI.  It's not just volume control, but master control of everything.

Now you need to play some sound.  Play a movie file or play a youtube video, with sound of course.  In the Input Device tab of pavucontrol, you should choose to show "monitors" at the bottom.  For each output device, you have a corresponding monitor device as the input that you can record.  Is that simple?  You should see the volume meter moving up and down.

Now you need some recording software.  The only thing that works for me is Audacity.  It's good for many thing else.  You can install it via the Ubuntu software center.  Fire up audacity.  There's typically nothing to set, or it doesn't matter that much.  Just in case, you need to set the 4 selector right above the sound wave area to ALSA, default, default, stereo.  You have to start recording with the red button or nothing will happen.

Now go back to pavucontrol.  At the record tab, you should see the application Audacity.  You just need to set the capture selector to "monitor of whatever sound device you are playing back".  And that is one of the monitors at the Input Device tab.

The settings will be remembered on a per application basis. (I think.)  So you can set the default sound device and settings for each application.  And because of this, without any configurations, it always give me the wrong device during playback.

No comments: