Skip to content

Instantly share code, notes, and snippets.

@sepastian
Created December 28, 2019 11:18
Show Gist options
  • Save sepastian/32034ba95bada0bc897d4b9a692f9136 to your computer and use it in GitHub Desktop.
Save sepastian/32034ba95bada0bc897d4b9a692f9136 to your computer and use it in GitHub Desktop.
Record audio that is currently output
# Record audio that is currently output.
# From https://askubuntu.com/questions/229352/how-to-record-output-to-speakers
sudo apt-get install pulseaudio-utils lame mpg123
pacmd list-sinks | grep -e 'name:' -e 'index' -e 'Speakers'
parec -d alsa_output.pci-0000_00_1f.3.analog-stereo.monitor | lame -r -V0 - out.mp3
# ctrl + c to stop recording
mpg123 out.mp3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment