Using the Sound Recorder application that comes in standard Ubuntu installations. To set this up using other programs (like audacity) just substitute it in these instructions.
- Install pavucontrol (PulseAudio Volume Control) using apt-get or the Ubuntu Software Center.
- Open PulseAudio Volume Control. It should be in the applications menu under Sound and Video.
- Open Sound Recorder and start recording. Playing any sound at this point would be helpful, as your level indicator should react once you have finished.
- Go to the “Recording” tab in the PulseAudio Volume Control window.
- Make sure that “Applications” is selected in the drop down menu on the “Recording” tab.
- Choose “Monitor of Internal Audio Analog Atereo” from the “Record Stream from” menu in the Sound Recorder entry of the application list.
This appears to be persistent so that you will only have to do this once, but you will have to repeat these steps to record in another application.