Skip to content

feat(dictation): transcribe long local dictations while recording - #511

Merged
DailyXplorer merged 1 commit into
mainfrom
feat/stream-dictation-pieces
Dec 5, 2026
Merged

DailyXplorer merged 1 commit into
mainfrom
feat/stream-dictation-pieces

Conversation

@DailyXplorer

Copy link
Copy Markdown
Owner

Summary

A long local dictation waited after the key was released for every piece of it to be transcribed. This transcribes the finished pieces while the user is still speaking, so the release only transcribes the tail.

Closes #477

Changes

  • engine/local/stream.rs: the recorder's tap feeds a worker that cuts the audio where split_at_pauses would cut the whole clip (pauses::next_cut, best pause before one pass's length, noise floor of the audio so far) and transcribes each closed piece on the dictation's LocalEngine, one at a time. Parked like the ChatGPT stream; a cancel or a non-local route drops it.
  • LocalEngine::transcribe_streamed: at the release, reuses the pieces when language, boost terms and level match what they were heard with, judges them with the whole clip's speech level, then transcribes only the rest. Any mismatch (the quiet-speech gain raised the clip, the window context changed) falls back to today's whole-clip path.
  • A dictation shorter than one piece (14.5 s on Apple silicon, 20 s on the CPU model) is never cut: same path and timing as before.
  • engine/local/seams.rs: deterministic seam repair (drop a period before a piece starting in lowercase; lower a capital the cut gave a word seen in lowercase elsewhere, so names keep theirs).
  • window_names::peek: the stream reads the window context (kind of app, screen terms) without consuming it; collect still returns it at the stop.
  • engine/local/stream_replay.rs: ignored harness that plays clips into the stream at the speed of speech on the real model.

Testing

  • bun run check: passed. cargo clippy --locked --all-targets -- -D warnings: clean. cargo test --locked --lib: 1828 passed.
  • New tests: the cutter matches split_at_pauses; the release hears only the tail and no piece twice; short dictations are never cut; a language change, a window read late, a model failure while recording and a cancel; silent pieces never reach the model; seam rules; peek.
  • Real model, Apple M4 Pro, synthetic speech (macOS say) with room noise added, played in real time (stream_replay), release to text:
clip whole clip (today) with pieces WER whole / pieces WER pieces vs whole
59 s 354-385 ms 123 ms 0.269 / 0.257 0.035
151 s 906-919 ms 169 ms 0.368 / 0.368 0.000
  • The local transcription is about 70 ms per 14.5 s piece on this Mac, so the saving grows with length and with slower machines (Intel and Windows run the CPU model).
  • Not tested: a real recording session in the app, Intel or Windows hardware. On a sample of local recordings, 1 in 7 was raised by the quiet-speech gain; those keep today's path.

@coderabbitai

coderabbitai Bot commented Dec 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a171206 and dba5877.

Files selected for processing: 15

  • AGENTS.md
  • src-tauri/src/actions.rs
  • src-tauri/src/actions/kind_style.rs
  • src-tauri/src/audio_toolkit/pauses.rs
  • src-tauri/src/commands/history.rs
  • src-tauri/src/engine/local/live_replay.rs
  • src-tauri/src/engine/local/mod.rs
  • src-tauri/src/engine/local/seams.rs
  • src-tauri/src/engine/local/stream.rs
  • src-tauri/src/engine/local/stream/tests.rs
  • src-tauri/src/engine/local/stream_replay.rs
  • src-tauri/src/managers/transcription.rs
  • src-tauri/src/utils.rs
  • src-tauri/src/window_names.rs
  • src-tauri/src/window_names/tests.rs

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.

Share

@DailyXplorer
DailyXplorer merged commit b58c06b into main Dec 5, 2026
22 checks passed
@DailyXplorer
DailyXplorer deleted the feat/stream-dictation-pieces branch December 5, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Idea: transcribe long dictations while the user is still speaking

1 participant