Skip to content

Pause MPRIS media while talking (v0.7.1) - #3

Open
pandadolphin wants to merge 18 commits into
pekinlcc:mainfrom
pandadolphin:main
Open

Pause MPRIS media while talking (v0.7.1)#3
pandadolphin wants to merge 18 commits into
pekinlcc:mainfrom
pandadolphin:main

Conversation

@pandadolphin

Copy link
Copy Markdown

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.

Phil Liu and others added 15 commits July 16, 2026 22:51
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.
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