4

I conduct business over Skype. Sometimes when I talk to clients they give a lot of instructions real quick. It would be nice to have a way to record conversations so that I could listen to them at a later point of time when I need them.

I have noticed people suggesting 'recordmydesktop', 'xvidcap', and 'ffmpeg' for recording. However, I DO NOT want to record video. I just want to record voice calls while having my headphones on. This means that I should be able to record the sound inline, not record it externally by pulling out my headphones and putting my clients on speaker (I know they can hear that, and they don't like it).

If there are ways you know that can solve my problem on a Debian 6 system, please let me know.

  • Are you using pulseaudio? ps xa | grep pulseaudio should show one if you are. – derobert Jul 29 '14 at 15:20
  • Yes I am. "ps xa | grep pulseaudio 3304 ? S<l 1:49 /usr/bin/pulseaudio --start 18810 pts/0 S+ 0:00 grep pulseaudio" – learnerX Jul 29 '14 at 15:53
  • See also stackoverflow.com/questions/7502380/… ... I wish we could move that question over here. – derobert Jul 29 '14 at 16:42
3

Via ALSA emulation

I don't have a Debian 6.0.x box to test on, but I think this way will probably work. Courtesy an example on the Arch wiki.

First, use pacmd list-sources to find the name of your sound card's monitor stream. Grep for .monitor works pretty well:

$ pacmd list-sources | grep '\.monitor'
        name: <alsa_output.pci-0000_00_1b.0.analog-stereo.monitor>
        name: <alsa_output.usb-stereo-link_stereo-link_1200_USB_DAC-00-DAC.analog-stereo.monitor>

I have two cards, hence two monitors. Then edit your ~/.asoundrc to set up an ALSA device for it, by adding lines like (but of course use your monitor device name, not mine):

pcm.pulse_monitor {
    type pulse
    device alsa_output.usb-stereo-link_stereo-link_1200_USB_DAC-00-DAC.analog-stereo.monitor
}

ctl.pulse_monitor {
    type pulse
    device alsa_output.usb-stereo-link_stereo-link_1200_USB_DAC-00-DAC.analog-stereo.monitor
}

Then use arecord -f s16_le -t wav -r 44100 -D pulse_monitor /tmp/outfile.wav to record.

Older PulseAudio Utilities

Instead of using ALSA emulation, you can use parecord on the monitor you found above. Do so like this: parecord -d alsa_output.usb-stereo-link_stereo-link_1200_USB_DAC-00-DAC.analog-stereo.monitor outfile.wav. That should work with parec as well (in the LAME example below)

Newer PulseAudio Utilities

PulseAudio ships with a parecord command-line utility that can record sound going through it.

To use it, first find the index of the stream you want to capture. Easy way from the command line is pacmd list-sink-inputs, which should give something like this:

1 sink input(s) available.
    index: 10720
        driver: <protocol-native.c>
        ⋮
        client: 87 <Chromium>
        ⋮

I've omitted a bunch of lines; but you can see that's Chromium (where I have a music player running). The index: 10720 bit is important.

To record it, it's as simple as parecord --monitor-stream 10720 outfile.wav. You can also write the output to stdout and use it as part of a pipe with parec; for example if you're short on disk space you could directly encode to MP3:

parec --monitor-stream 10720 --format s16le --channels 2 --rate 44100 \
    | lame -r -s 44.1 -b 16 --signed --little-endian --preset medium /dev/stdin outfile.mp3
  • It says "parecord: unrecognized option '--monitor-stream". I checked out the 'man' of parecord, the '--monitor-stream' switch isn't listed there. Any ideas? – learnerX Jul 29 '14 at 16:10
  • @intellikid Hmmm, must not be present in PulseAudio 0.9. That's what I get for testing on jessie... Trying to find an alternative. – derobert Jul 29 '14 at 16:13
  • "pulseaudio --version" tells me I am using version 2.0 – learnerX Jul 29 '14 at 16:23
  • @intellikid OK! have another method that'll hopefully work. Also, you sure you're on Debian 6.0 (squeeze) and not 7.0 (wheezy)? – derobert Jul 29 '14 at 16:26
  • 1
    It worked!! The first solution (by editing the ~/.asoundrc). Thank You! I do have a question though. I wanted to record both sides of the conversation. Mine as well. Since this records the sound inline, would it capture what I say (my laptop mic) as well? – learnerX Jul 29 '14 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.