demko.ca

<< Back to Posts

How to record your Skype conversation in Linux

Aleksander Demko November, 2007

This note describes how to record your half of a Skype conversation to a high quality file. This process doesn't record the other party's voice -- it's assumed they will record their own voice locally and you'll mix them together afterwards. This is a standard pod-casting trick.

If you google up this topic you'll find essentially two solutions for this. On involves simply recording via ALSA and running Skype as usual. This didn't work for me at all, I think because it depends on some odd trick that worked when Skype was an OSS application.

Similarly, someone else made a skype-rec script, which seems to intercept audio calls from Skype with some magic. Although a clever effort, I was pretty sure that I didn't need something this intricate.

Skype 1.4 for Linux seems to be fully ALSA compliant now. ALSA is the awesome sound system in Linux that displaced the older, but still kicking OSS. Using ALSA, we will simply create a virtual capture/microphone device that is sharable by more than program (namely, skype and arecord).

(As a side note, I never recommend Audacity for recording, especially with ALSA and especially with USB devices. I use Audacity for post-processing, but I do my live recording via the arecord ALSA utility)

First, simply add a section like this to your ~/.asoundrc (create that file if necessary)

pcm.snooped {
  type dsnoop
    ipc_key 1234
  slave {
    pcm "hw:0,0"
      channels 1
    }
}

This will create a new capture-support PCM device called "snooped". It uses the dsnoop type to allow your existing device hw:0,0 to be "snooped" by one or more programs. Replace hw:0,0 with hw:1,0 if your mic isn't on your first sound card (run arecord --list-devices to get a list of your capture devices). Change the channels number to 2 if you need stereo recording.

Now, in Skype simply make sure to use the snooped device for mic input.

To record your end simultaneously to a file, run the following:

arecord -f S16_LE -c 1 -r 48000 -D snooped -v -v output.wav