Files
voculinux/tests
Jatin K MalikandGitHub 113c846d52 fix(ptt): prevent premature transcription during push-to-talk silence (#359)
* fix(ptt): prevent premature transcription during push-to-talk silence

In push-to-talk mode, a brief silence while holding the hotkey would
trigger transcription mid-hold, injecting text before key release.

Add recognition_mode parameter to start_recognition() so the silence
timeout in _record_audio() defers enqueuing audio in PTT mode. Audio
accumulates in the buffer until key release calls stop_recognition(),
which already handles final buffer enqueue. Toggle mode is unchanged.

* fix(clipboard): run clipboard copy in background thread to prevent blocking

The _copy_to_clipboard calls (wl-copy, xclip, xsel) have 5s timeouts
each and run synchronously on the recognition thread. When they hang,
they block stop_recognition() from completing, delaying the state
transition to IDLE and preventing the next push-to-talk press.

Move clipboard copy to a daemon thread on the two success paths so it
never blocks transcription or state transitions. The failure-fallback
path stays synchronous since it needs the return value.
2026-03-28 00:53:45 -07:00
..