Skip to content

Commit 4e24704

Browse files
snomiaoclaude
andcommitted
feat(PTT): enable otoji polish + TTS for pronunciation feedback
Pass --ptt-polish auto --ptt-tts auto to otoji so: - Punctuation gets LLM-corrected (e.g. "how are you." → "how are you?") before CLX types it at cursor. - The polished text is spoken back via TTS (afplay) after release, giving auditory feedback for correct pronunciation. Both features gracefully no-op when the required API keys aren't configured — the raw ptt_final still arrives as before. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 20bd8b6 commit 4e24704

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

rs/core/src/modules/voice_otoji.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,16 @@ impl OtojiBackend {
124124
// Use `otoji listen --plain -` to read WAV from stdin instead of
125125
// opening the mic itself. CLX has mic permission; otoji may not.
126126
let mut cmd = Command::new("otoji");
127-
cmd.args(["listen", "--plain", "-"])
128-
.stdout(Stdio::piped())
129-
.stderr(Stdio::piped())
130-
.stdin(Stdio::piped())
131-
.env("OTOJI_RELAUNCHED", "1")
132-
.env("OTOJI_REBUILDING", "1"); // prevent auto-rebuild + exec which breaks pipes
127+
cmd.args([
128+
"listen", "--plain", "-",
129+
"--ptt-polish", "auto", // fix punctuation (e.g. `.` → `?` for questions)
130+
"--ptt-tts", "auto", // speak the polished text back for pronunciation feedback
131+
])
132+
.stdout(Stdio::piped())
133+
.stderr(Stdio::piped())
134+
.stdin(Stdio::piped())
135+
.env("OTOJI_RELAUNCHED", "1")
136+
.env("OTOJI_REBUILDING", "1"); // prevent auto-rebuild + exec which breaks pipes
133137

134138
// NOTE: process_group(0) was disabled — it may interfere with signal
135139
// delivery from parent to child on macOS. We kill otoji explicitly

0 commit comments

Comments
 (0)