Initial commit
This commit is contained in:
27
usr/local/bin/record.sh
Executable file
27
usr/local/bin/record.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
recordingDir=~/Audio
|
||||
mkdir -p "$recordingDir"
|
||||
|
||||
pidFile="/tmp/game_recording.pid"
|
||||
|
||||
if [[ -f "$pidFile" ]]; then
|
||||
pid=$(cat "$pidFile")
|
||||
if ps -p "$pid" > /dev/null 2>&1; then
|
||||
kill "$pid"
|
||||
spd-say -Cw "Recording stopped"
|
||||
play -qV0 "|sox -np synth .07 sq 400" "|sox -np synth .5 sq 800" fade h 0 .5 .5 norm -20 reverse
|
||||
else
|
||||
spd-say -Cw "Recording process not found, cleaning up"
|
||||
fi
|
||||
rm "$pidFile"
|
||||
else
|
||||
spd-say -Cw "Recording starting in"
|
||||
for i in {3..1}; do
|
||||
spd-say -Cw "$i"
|
||||
sleep 0.5
|
||||
done
|
||||
play -qV0 "|sox -np synth .07 sq 400" "|sox -np synth .5 sq 800" fade h 0 .5 .5 norm -20
|
||||
ffmpeg -f pulse -i "$(pactl get-default-sink).monitor" "$recordingDir/game_$(date +%F_%H-%M-%S).ogg" &
|
||||
echo "$!" > "$pidFile"
|
||||
fi
|
||||
Reference in New Issue
Block a user