feat: live macOS dictation — push-to-talk mic into the realtime ASR session
- /dictate + ctrl+shift+d toggle one shared session: press to start, press again to stop, flush and paste into the prompt (a terminal gives no key-release event for hold-to-talk without the Kitty keyboard protocol) - client.recordMic(): spawns ffmpeg AVFoundation capture and appends s16le frames as they arrive (no pacer — the mic is already 1x paced); stop() = commit + the same quiescence drain transcribe() uses, since is_last_result never flips true - enumerates mics by slicing the "AVFoundation audio devices:" block off stderr (ffmpeg prints the table there, then fails opening the dummy input) - --device takes an index or name, --lang / ASR_DICTATE_LANGUAGE, --submit sends instead of pasting; asr_health now reports the mic inputs it enumerated - capture death surfaces via the emptyGraceMs path with the TCC hint (System Settings → Privacy & Security → Microphone) when ffmpeg exits non-zero at 0 bytes - env.sh sources the gitignored .env so a shell gets ASR_NIM_URL / ASR_API_KEY
This commit is contained in:
1 parent
19faa8b088
commit
0b44d7e1bf
4 files changed
+307
-4
No files matched your search
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Load pi-asr local env (secrets live in the gitignored .env).
|
||||
# Run from the repo root: source ./env.sh
|
||||
[ -f ./.env ] && { set -a; . ./.env; set +a; } || { echo "[pi-asr] no ./.env found (run this from the repo root)"; return 1 2>/dev/null || exit 1; }
|
||||
_k="${ASR_API_KEY:-}"
|
||||
[ -n "$_k" ] && _m="set (${#_k} chars, ${_k:0:5}...)" || _m="UNSET"
|
||||
echo "[pi-asr] ASR_NIM_URL=${ASR_NIM_URL:-<unset>} key=${_m}"
|
||||
unset _k _m
|
||||
Reference in new issue
Block a user