Recording internal audio in Linux |
Sounds perfect, except the fact that it has been already implemented. Meanwhile, through numerous visits to stackoverflow and askUbuntu I finally discovered a cool new way to record audio.
- pacat --record -d alsa_output.pci-0000_00_1f.3.analog-stereo.monitor | sox -t raw -r 44100 -s -L -b 16 -c 2 - dump.wav
This uses pacat to record the audio and then sox to convert it to wav and then save it. We could even go one step further and pipe this to netcat giving us the following command.
- pacat --record -d alsa_output.pci-0000_00_1f.3.analog-steremonitor | sox -t raw -b 16 -e signed -c 2 -v 7 -r 44100 - -t wav - | nc -l 7777
This will stream the wav file using netcat on port 7777. This file can be saved by another netcat client and later played with vlc.
If you get any error while firing these commands check your output for the following command
- pacmd list | grep "\.monitor"
Here is my output
name: <alsa_output.pci-0000_00_1f.3.analog-stereo.monitor>
alsa_output.pci-0000_00_1f.3.analog-stereo.monitor/#0: Monitor of Built-in Audio Analog Stereo
No comments:
Post a Comment