From 68ffa486d376c57cfc0212825f1139d19f15e562 Mon Sep 17 00:00:00 2001 From: navewindre Date: Thu, 27 Mar 2025 03:06:27 +0100 Subject: ye --- record.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 record.sh (limited to 'record.sh') diff --git a/record.sh b/record.sh new file mode 100755 index 0000000..e5e05e9 --- /dev/null +++ b/record.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +rm /tmp/desktop_audio_temp.mp3 + +cleanup() { + echo "Recording stopped. Cleaning up..." + kill $FFMPEG_PID + echo "file:///tmp/desktop_audio_temp.mp3" | xclip -sel c + gxmessage -geometry 350x50 -title "audio recorded" -center "desktop dudio has been copied to your clipboard." + exit 0 +} + +trap cleanup SIGINT SIGTERM + +ffmpeg -f pulse -i alsa_output.usb-FX-AUDIO-_DAC-X3PRO_20313330544D4319001C8004-00.analog-stereo.monitor /tmp/desktop_audio_temp.mp3 & + +FFMPEG_PID=$! +while true; do + read -t 0.1 -n 1 key + if [[ $key == $'\e' ]]; then + cleanup + fi +done + +wait $FFMPEG_PID -- cgit v1.2.3