Skip to content

Add Linux desktop clients (tray recorder + local dictation) under linux/ - #492

Open
mr6874000 wants to merge 2 commits into
rishikanthc:mainfrom
mr6874000:feature/linux-dictation-client
Open

mr6874000 wants to merge 2 commits into
rishikanthc:mainfrom
mr6874000:feature/linux-dictation-client

Conversation

@mr6874000

Copy link
Copy Markdown

What changed

Added a new linux/ directory containing the desktop client daemons that were developed in the standalone live-transcription-client repo (now preserved here so the client work lives with the server):

  • linux/tray_recorder.py — X11 tray daemon: F9 starts / F10 stops recording via pw-record, uploads to the server's /api/record, polls status, and copies the finished transcript to the clipboard (xclip).
  • linux/live_dictate.py — X11 tray daemon: F8 toggles local, offline live dictation — pw-record streams 16 kHz mono audio → chunked faster-whisper (base.en, CPU int8, ~25-30x realtime) → text is typed at the cursor of the focused window via xdotool. Desktop notifications (notify-send) confirm "good to go" on start, typed character count on stop, and errors. Includes a --test [file] mode for verifying the STT engine without a mic.
  • linux/test_api_roundtrip.py — standalone API roundtrip test against the server.
  • linux/live-transcription-client.service + linux/live-dictation.service — systemd user units (paths updated to the new location).
  • linux/README.md, linux/requirements.txt, linux/.gitignore — setup docs, deps (faster-whisper + av>=18,<19 pin), ignores.
  • Plan + work log included (linux-dictation-client.md, work-logs/).

Why

The client code was living in a throwaway repo at ~/projects/live-transcription-client; both daemons are verified working in production on the dev box. Moving them into the established Scriberr repo under an OS-specific linux/ folder (X11/PipeWire/xdotool are Linux-specific) keeps everything together and safe.

How to verify

  • cd linux && /path/to/venv/bin/python live_dictate.py --test /path/to/last-take.wav → prints transcript + timing, exits 0 (verified: 89s take in ~2.8s, 32x realtime).
  • python -m py_compile passes on all three scripts; .py files are byte-identical to the production copies.
  • Live run: daemon shows tray icon, F8 starts dictation with "Dictation started" notification, typed text appears at the cursor, F8 again stops with a "Typed N characters" notification.

Notes / follow-ups

  • Optional migration after merge: the live systemd install still runs from the old path (/home/atlas/projects/live-transcription-client). To migrate: pip install -r linux/requirements.txt in a venv at the new location, copy the two units to ~/.config/systemd/user/, systemctl --user daemon-reload && systemctl --user restart .... Not required — both locations work.
  • Prerequisite for dictation typing: sudo apt install xdotool (already installed on the dev box).

Move the standalone live-transcription-client daemons into the repo so the desktop client work lives with the server: tray_recorder.py (F9/F10, pw-record -> /api/record -> clipboard) and live_dictate.py (F8 toggle, pw-record -> faster-whisper offline STT -> xdotool types at cursor, notify-send notifications). Systemd user units updated to the new path; OS-specific, hence linux/.
Dictation now flushes on natural speech pauses (Silero VAD, >=300ms silence) or at the 4s cap instead of fixed 3s chunks: text flows phrase by phrase with ~0.4s latency. LT_DICTATE_CHUNK_MODE=fixed keeps legacy behavior. New --test-chunks dev mode. Verified: 89s take -> 27 chunks, avg flush latency 0.36s.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant