Feature: opt-in local voice mode (/say TTS + /listen STT) #2005
NateFoxtrot
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What
Opt-in voice mode for the interactive TUI:
/say <text>speaks the agent's reply through a local TTS server,/listenrecords up to 8s of speech, transcribes it, and drops the transcript into the editor as your next prompt.Working implementation: https://github.com/NateFoxtrot/prime-agent/tree/feat/voice-mode (single commit,
tsgo --noEmit+ biome clean, based on currentmain).Why
Hands-free field/homelab use: hear agent output while reading a monitor elsewhere, and reply by voice while both hands are on the task. Everything is local — no cloud TTS/STT, no new npm deps.
How it works
/say <text>→ POST{text, voice}to a local TTS HTTP endpoint (defaulthttp://127.0.0.1:9460/tts; any server returning a wav body works — I use a small Qwen3-TTS wrapper). Falls back toespeak-ng -wif the server is down. Playback viampv./listen→ records via soxrec(16kHz mono wav), transcribes withfaster-whisper(small, int8, CPU), inserts the transcript into the editor.Config (env):
PRIME_TTS_URLhttp://127.0.0.1:9460/ttsPRIME_TTS_VOICEserenaPRIME_AUDIO_PLAYERmpvPRIME_VOICE0disables both commandsAll external tools fail silently — no TTS server, no sox, no whisper → the commands just no-op, never break the session.
Files:
packages/coding-agent/src/core/voice.ts(new, ~95 lines, zero deps) +/say/listenhandlers ininteractive-mode.ts.Happy to open a PR if there's interest — open to swapping faster-whisper for any local STT the project prefers (whisper.cpp, vosk) or gating the feature behind a settings flag instead of env.
All reactions