Add dictation: speak into the message box without a spoken reply - #36
Open
Piggidragon wants to merge 1 commit into
Open
Piggidragon wants to merge 1 commit into
Piggidragon wants to merge 1 commit into
Conversation
A microphone button next to the voice-mode button transcribes what is said and either types it into the message box at the cursor (edit first) or sends it when the speaker pauses. It reuses voice mode's in-browser speech detection and transcription route, so it needs no speech synthesis and loads nothing onto the GPU. The voice-mode button becomes the waveform icon so the two are told apart. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 7 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Piggidragon
marked this pull request as ready for review
September 19, 2026 20:51
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Dictation: speak into the message box without a spoken reply. Voice mode is a conversation; this is for when you only want words in the box.
A microphone button sits next to the voice-mode button, which becomes the waveform icon so the two are told apart. A line above the box shows whether you are heard and the words recognised so far, and switches where they go (remembered per browser):
How
Nothing new on the server. It reuses voice mode's in-browser Silero endpointing,
LiveTranscription(speculative snapshots for the live words) andPOST /api/sessions/:id/voice/transcribe, so it works as soon as Voice is enabled, needs no speech synthesis and loads nothing onto the GPU.web/src/use-dictation.ts: the hook. One run owns the mic, audio context and VAD; transcriptions are queued so phrases land in order. Stopping pauses the VAD first, so a sentence in progress is still delivered, then releases the mic once the queue is drained.web/src/dictation.ts:insertAtCaretandcleanTranscript(Whisper answers silence with[BLANK_AUDIO]/(silence); a transcript made only of such notes is dropped, brackets inside a sentence are kept).web/src/components/Dictation.tsx: button and status line.Chat.tsx: the caret and draft are tracked in refs so several phrases arriving before a render each land after the last;sendis split intosubmit, so spoken text takes the same path as typed text (client commands included).Voice mode and dictation share the microphone: starting voice mode stops dictation. Leaving the session aborts anything not yet transcribed, so words heard in one conversation cannot be sent to another.
Testing
tests/dictation.test.mts(8 cases): caret insertion spacing and selection replace, silence placeholders. The rootnpm testnow runstests/*.test.mtsinstead of one named file.Not tried with a physical microphone. The 60 s cap on a single recording (same as voice mode) is not exercised.
🤖 Generated with Claude Code