Pause MPRIS media while talking (v0.7.1) - #3
Open
pandadolphin wants to merge 18 commits into
Open
Conversation
Hold-to-talk now pauses Playing players via playerctl and resumes them on release/cancel so music does not talk over the mic. Gated by audio.pause_media_on_talk (default on); requires the playerctl package.
…API key files Extract TranscriptEvent to types; add GrokSttClient with accumulator, probe/warmup, KD-16 ws_connect helper (migrate Doubao), gitignore for *.key.
Improve post-EOS error handling, separate finalize/audio.done sends, expand classify/probe tests, and clean small nits.
…reliability, linger-safe deadlines Wire is_complete/factory/daemon for grok; KD-18 verification; KD-15 session cancel; KD-12 finalize deadlines; CHANGELOG behavior notes.
Fix cancel TOCTOU for C0; align release linger with deadline caps; address remaining review items.
CLI+GTK provider select, Grok fields and Mandarin warning, probe via GrokSttClient (transcript.done), no forced provider=doubao.
Fix localhost hatch wiring, OSError status misclassification, GTK Mapping guards, and CLI non-wss save order.
Document optional Grok provider, secret handling, finalize wait defaults, and Mandarin unvalidated gate. Doubao remains default.
Clean INSTALL probe/save wording and minor formatting.
Reload config.json in-process so Doubao/Grok switches take effect without restarting (deferred while a session is in flight; unverified saves keep the running provider). Console Settings can still bounce the daemon; systemd no longer restart-loops on exit 2/3; SIGTERM stop is bounded; RightAlt/RightCtrl are valid hold-to-talk keys; empty Grok finals fail fast instead of blocking inject for 31s.
Quiet/distant PCM is gated as silence; moving the mic close restored realtime accuracy on the same Grok path (observed 2026-08-30).
Three short auditory cues so dictation works eyes-off: start (tick), stop (tok) at key-up / cancel, done (ding) after a paste that landed. The start cue is driven by AudioCapture.on_session_live, fired once per session when the first live PCM chunk after start() reaches the session queue. It is never driven by the hotkey callback, so a press rejected during FINALIZING or a reload, or a mic that delivers nothing, stays silent — and that silence tells the user nothing is being recorded. Playback is fire-and-forget on one worker thread (safe from the PortAudio callback). Backends: sounddevice, paplay --latency-msec=30, pw-play, aplay, each dropped after one failure; none is required. New `sounds` config section (enabled, volume, per-cue switches, custom 16-bit WAV per cue), console Settings exposes enable + volume, reload rebuilds the player. daemon.log gains "mic live: first chunk N ms after press" per session.
docs/sound-cues.md records the start-cue invariant, the wiring, the measured latencies (press → mic live 10–34 ms in live sessions, ≤ 106 ms worst case; paplay 219 → 112 ms with --latency-msec=30), the config surface, backend fallback, and the echo-into-mic trade-off with the live check done on 2026-09-02.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hold-to-talk now pauses Playing players via playerctl and resumes them on release/cancel so music does not talk over the mic. Gated by audio.pause_media_on_talk (default on); requires the playerctl package.
I've only tested on my own laptop running Ubuntu 22.04 LTS.