Reputation: 26768
I'm trying to record the sound my computer produces (without using a microphone)
I've found these two commands that work to record my microphone output into files:
# creates mp3
arecord -f cd > my_file.mp3
# creates ogg
arecord -f cd -t raw | oggenc - -r -o out.ogg
However I am not sure how to record the audio coming out of my speakers directly.
I should note that I have figured out how to do this using PulseAudio and Audacity - there's a good tutorial here however it broke my microphone input and also I would like to be able to do it from the command line.
Upvotes: 2
Views: 1041
Reputation: 26768
Revisiting this 5 months later, I finally figured it out.
From the answer here:
sudo apt-get install pulseaudio-utils lame mpg123
pacmd list-sinks | grep -e 'name:' -e 'index' -e 'Speakers'
, find the string in between <>
brackets - for me it's alsa_output.pci-0000_00_1b.0.analog-stereo
parec -d alsa_output.pci-0000_00_1b.0.analog-stereo.monitor | lame -r -V0 - out.mp3
Now for the tricky part, the file for some reason cannot be listened to with aplay
- it just sounds like static. Listen to it with mpg123
instead.
Upvotes: 2