Hi, On Sat, 2 Oct 2021 03:55:50 -0400 lou <loushanguan2...@sina.com> wrote:
> Could you give me commands that record sound being played? apart from the solution using alsaloop Dan already pointed out, there is a rather simple way to do this with Alsa's OSS compatibility modules: sudo modprobe snd-pcm-oss aumix -v R Explanation: The first command loads the oss-compatibility drivers (snd-pcm-oss and snd-mixer-oss); to automatically load these drivers on each boot, just add the line snd-pcm-oss to /etc/modules . The second command sets the main Volume channel (-v) as recording source (R); you may need to do sudo apt install aumix first, though. Of course, you can use any gui mixer app that can handle the OSS mixer device instead of the shell command to set the recording source. Just select the channel that is usually labeled "Vol". > > Can arecord use mp3 format? Not directly as far as I know. However you can use something like: arecord -V stereo -f cd | sox -t wav -r 44100 -c 2 -b 16 - test.mp3 (requires sox and libsox-fmt-mp3). This should create a 128 kBit/sec CBR mp3 output file. Please consult the manpages of arecord and sox for fine tuning each command's options. Best regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. Totally illogical, there was no chance. -- Spock, "The Galileo Seven", stardate 2822.3