Last active
January 26, 2022 21:35
-
-
Save rudolfbyker/0c613d20842b36e13b8482c6b34ff058 to your computer and use it in GitHub Desktop.
Revisions
-
rudolfbyker revised this gist
Jan 26, 2022 . No changes.There are no files selected for viewing
-
rudolfbyker created this gist
Jan 26, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ #!/usr/bin/env bash # Delete old recordings. DIR="$HOME/rec" EXPIRE=7 find $DIR -mtime +$EXPIRE -type f -delete This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ #!/usr/bin/env bash # Put recordings in this folder DIR="$HOME/rec" # Prefix each file name with a timestamp NAME=$(date +%Y%m%d%H%M%S) # Split recording after $SEG seconds SEG=3600 # Start recording # ALSA: (this works more directly with the hardware, but it disables pulseaudio, which is not so nice) #ffmpeg -loglevel warning -f alsa -i hw:0 -f segment -segment_time $SEG ${DIR}/${NAME}_%d.mp3 # Pulseaudio: # TODO: Wait for pulseaudio to start! ffmpeg -loglevel warning -f pulse -i alsa_input.pci-0000_00_1b.0.analog-stereo -f segment -segment_time $SEG ${DIR}/${NAME}_%d.mp3