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> |