Posted: . At: 10:04 AM. This was 3 years ago. Post ID: 14762
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.



Sponsored



How to record PC sound to a file with ffmpeg and Pulseaudio.


Recording sound from your computer to a file is pretty easy with Pulseaudio. Assuming you know what device you are using to listen to audio, then it may be selected and recorded from.

Use this command to find the device name.

~$ pacmd list-sources

Then you may get the device string.

alsa_output.usb-Cosair_Corsair_VOID_PRO_Surround_USB_Adapter_00000000-00.analog-stereo.monitor

Make sure it is the output and not the input.

Then supply this string to ffmpeg as the recording device.

ffmpeg -f pulse -i alsa_output.usb-Cosair_Corsair_VOID_PRO_Surround_USB_Adapter_00000000-00.analog-stereo.monitor pcsound.wav

Then your PC sound will be recorded to a file easily.

This variant will record from the headset microphone with very good quality.

ffmpeg -f pulse -i alsa_input.usb-Cosair_Corsair_VOID_PRO_Surround_USB_Adapter_00000000-00.analog-stereo sound.wav

I wish that Ubuntu would come with a sound recorder program like Windows 3.1 did, that would make this easier, but this tip works just fine.

This is another way to get the current sound output device.

┌─[jason@jason-desktop][~]
└──╼ $ pacmd list-sink-inputs | grep sink:
	sink: 4 <alsa_output.usb-Cosair_Corsair_VOID_PRO_Surround_USB_Adapter_00000000-00.analog-stereo>

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.