in reply to Diverting audio output to a file.

This is not a Perl solution, but the command is taken from Speech::Recognition::Vosk. ffmpeg can easily record output from various inputs. Assuming that you have PulseAudio on your Debian system, this records from the Pulse device $device.

ffmpeg -hide_banner -loglevel error -nostats -f pulse -i "$device" -t +30 -ac 1 -ar 44100 -f s16le "$output_file"

Which device is the correct one, you can find using the following pactl command:

pactl list short sources

Replies are listed 'Best First'.
Re^2: Diverting audio output to a file.
by phirun (Novice) on Feb 27, 2022 at 21:02 UTC
    Hey, that looks interesting. I'll give it a try, and thanks!