From 953bf9f287699591077a42bbc030878d567e8cb6 Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Fri, 5 Jun 2026 18:22:47 +0200 Subject: [PATCH] Add audio feedback (beeps) on recording start/stop --- linux/blitztext/daemon.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/linux/blitztext/daemon.py b/linux/blitztext/daemon.py index c2f365c..6053f75 100644 --- a/linux/blitztext/daemon.py +++ b/linux/blitztext/daemon.py @@ -133,6 +133,12 @@ class Daemon: self._vad_meter.stop() self._vad_meter = None + def _play_sound(self, sound_name: str) -> None: + import os, subprocess + path = f"/usr/share/sounds/freedesktop/stereo/{sound_name}.oga" + if os.path.exists(path) and shutil.which("pw-play"): + subprocess.Popen(["pw-play", path], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + # -- recording control ---------------------------------------------------- def start_dictation(self, workflow: Workflow | None = None) -> None: wf = workflow or self._route_workflow @@ -179,6 +185,7 @@ class Daemon: self._emit("recording", wf.name, "Recording…") self._notify(f"● {wf.name}", "Recording…") + self._play_sound("device-added") def finish_dictation(self, send_enter: bool = False) -> None: self._vad_stop() @@ -206,6 +213,7 @@ class Daemon: return audio_path = rec.stop() + self._play_sound("complete") threading.Thread( target=self._process, args=(audio_path, wf, win, send_enter), daemon=True ).start() @@ -230,10 +238,12 @@ class Daemon: streamer.stop() self._emit("idle", None, "Cancelled") self._notify("Cancelled", "Streaming stopped.", "low") + self._play_sound("device-removed") return rec.discard() self._emit("idle", None, "Cancelled") self._notify("Cancelled", "Recording discarded.", "low") + self._play_sound("device-removed") def toggle(self, workflow: Workflow) -> None: """Start recording, or stop + process (used by GUI clicks and combos)."""