Jérôme Belleman
Home  •  Tools  •  Posts  •  Talks  •  Travels  •  Graphics  •  About Me

Recording the Sounds of your Computer

13 Jan 2018

I'd often like to record discussions from conference calls, but the conference software won't allow it. How about recording the sound your system makes?

1 PulseAudio to the Rescue

The very versatile PulseAudio sound server comes with the parec command – which just stands for PulseAudio record – and does what you expect with little to no effort:

parec -d your-device.monitor

If you use a decent, modern shell such as zsh, typing parec -d  Tab will even suggest suitable devices, along with a short description for each of them. The one you'll be interested in will be labelled along the lines of Monitor of built-in audio.

2 Output

The parec command will just write the sounds it records from your system to standard output. This makes it very tempting to pipe it right off to another audio compression tool. I like using TwoLAME to convert audio to MP3:

parec -d your-device.monitor | twolame -r - out.mp3

For reading from standard input, which is requested from the - argument as input file, TwoLAME will require you to also pass the -r – --raw-input – switch. Recording raw audio data is what parec does by default anyway.

3 Volume

What happens if you change the volume while recording? This will depend on what volume you change. The versatility PulseAudio offers comes with the price of complexity, and one aspect thereof is that there are many different levels of volumes to adjust.

There's what I'd call the master volume, simultaneously controlling the volume of all what you hear from your system. Changing the master volume will not be noticed in the recording made by parec. However, changing the volume of a given application will be noticed. So if you change the volume specific to your conference software during recording, the change will be heard in the recording too.

4 References