Commit Graph
3 Commits
Author SHA1 Message Date
Willem van den Ende ffa95852c0 fix(live-dictate): pick the real microphone and add a diagnose command
Dictation was silent even with a working server: avfoundation index 0 on
this machine is "Microsoft Teams Audio", a virtual driver that records
pure digital silence, and the device was hard-wired to ":0".

- resolve the input device on darwin by name instead of by index, since
  indices shift as devices appear and disappear; prefer
  live-dictate-device-name-pattern (built-in microphone) and skip
  virtual/loopback drivers matched by live-dictate-ignore-device-name
- allow the device to be pinned either as a raw index (":2") or as a
  regexp matched against the reported device names
- announce the selected device when dictation starts and name it in the
  silence warning
- add `live-dictate-stop' as an explicit command (the keybinding stays a
  toggle: SPC A d starts and stops)
- add `live-dictate-diagnose', which lists the devices, records two
  seconds and reports whether the chosen one delivers audio or digital
  silence (the latter means the OS microphone permission is missing)

config-mac.el stops pinning ":0" and documents the auto-selection.
2026-11-05 12:26:14 +00:00
Willem van den Ende 580b213793 fix(live-dictate): talk to whisper.cpp's HTTP API instead of Lemonade realtime
Live dictation sent the OpenAI realtime protocol to ws://host/v1/realtime,
which only Lemonade-style servers implement.  Against the local
whisper-server on port 13305 every connection failed with
"websocket-received-error-http-response 404".

Retarget the module at whisper.cpp's native POST /inference endpoint:

- capture 16 kHz mono PCM16 with FFmpeg (now with binary process coding,
  which the old version lacked and which would have corrupted the audio)
- cut the stream into utterances with an energy-based VAD: speech starts
  above live-dictate-silence-threshold, flushes after a configurable
  silence window, with pre-roll and a max-utterance cap
- wrap each utterance in a WAV header and post it with curl, one request
  at a time so transcripts are inserted in spoken order
- insert text at the dictation marker with correct spacing, keep the
  mode-line indicator and follow-cursor behaviour
- warn when the microphone delivers pure digital silence (OS permission)

New defcustoms: live-dictate-language, -prompt, -silence-threshold,
-silence-duration, -min-utterance, -max-utterance, -preroll.

Comments in config-mac.el and packages.el updated; websocket is no
longer needed by dictation.
2026-11-05 12:14:30 +00:00
Willem van den Ende 841fbabaea adopt(linux): add live-dictate and firehose-blog from linux-adopt
Two files that exist only on the Linux side, taken verbatim:

  lisp/live-dictate.el   streaming dictation over the Lemonade
                         OpenAI-compatible API (linux repo 978aa86)
  qwan/firehose-blog.el  drag-and-drop images into a firehose blog post,
                         with year dirs, collision suffixes and 16 ERT tests

Both are inert until something requires them.  Wiring lives in
config-linux.el (next commit), not in the shared config.el: live-dictate
depends on whisper.el plus a Lemonade server on :13305, and on macOS
neither exists yet.  Getting live dictation working there is a feature,
not a port: ffmpeg capture, an installed whisper.el, and a reachable
backend.

firehose-blog.el is OS-independent by design and should later replace
qwan/qwan-markdown-dnd.el on both sides -- see the note in config.el.
2026-11-03 12:32:31 +00:00