5

The command arecord foo.wav records from microphone and saves to file foo.wav.

Is there a way I can have arecord record what is coming out of speakers instead of recording from microphone? Or perhaps there are other command line tools that can do this?

I would rather avoid bloaty graphical tools like Audacity.

I am on Arch if it makes any difference.

math4tots
  • 2,685

1 Answers1

1

The Arch Wiki tells you how to setup an ALSA source as a monitor.

Basically, use pactl list to find the name of your source, something that includes analog-stereo.monitor. Then add to /etc/asound.conf or ~/.asoundrc the following lines:

pcm.pulse_monitor {
  type pulse
  device alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
}

ctl.pulse_monitor {
  type pulse
  device alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
}

Then select that source for recording. The arecord manual lists some options for specifying a device to use if it doesn't automatically use the right one.

-l, --list-devices
    List all soundcards and digital audio devices 
-L, --list-pcms
    List all PCMs defined 
-D, --device=NAME
    Select PCM by name 
Ramesh
  • 39,297
fooot
  • 794