Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d9292f507 | |||
| 5b723b94f9 |
@@ -14,8 +14,8 @@ Go to the Releases page, download `WinDictation.zip`, extract, and run `win-dict
|
|||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
- **[User Manual](win-dictation-user-manual.html)** — How to use every feature
|
- **[User Manual](win-dictation-user-manual.md)** — How to use every feature
|
||||||
- **[Architecture & Engineering Review](win-dictation-architecture-engineering-review.html)** — Deep dive into the codebase for developers
|
- **[Architecture & Engineering Review](win-dictation-architecture-engineering-review.md)** — Deep dive into the codebase for developers
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ Go to the Releases page, download `WinDictation.zip`, extract, and run `win-dict
|
|||||||
3. Speak, then press `Ctrl+Shift+Space` again
|
3. Speak, then press `Ctrl+Shift+Space` again
|
||||||
4. Your words appear in the app you were using
|
4. Your words appear in the app you were using
|
||||||
|
|
||||||
Full instructions in the [User Manual](win-dictation-user-manual.html).
|
Full instructions in the [User Manual](win-dictation-user-manual.md).
|
||||||
|
|
||||||
### Controls
|
### Controls
|
||||||
- **Record/Stop**: Click the pill or press `Ctrl+Shift+Space`
|
- **Record/Stop**: Click the pill or press `Ctrl+Shift+Space`
|
||||||
@@ -130,7 +130,7 @@ This project is licensed under GPLv3. It incorporates [whisper.cpp](https://gith
|
|||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
|
|
||||||
- [User Manual](win-dictation-user-manual.html)
|
- [User Manual](win-dictation-user-manual.md)
|
||||||
- [Architecture & Engineering Review](win-dictation-architecture-engineering-review.html)
|
- [Architecture & Engineering Review](win-dictation-architecture-engineering-review.md)
|
||||||
- [Whisper.cpp](https://github.com/ggerganov/whisper.cpp)
|
- [Whisper.cpp](https://github.com/ggerganov/whisper.cpp)
|
||||||
- [Model Downloads](https://huggingface.co/ggerganov/whisper.cpp)
|
- [Model Downloads](https://huggingface.co/ggerganov/whisper.cpp)
|
||||||
|
|||||||
@@ -0,0 +1,376 @@
|
|||||||
|
# Win Dictation — Architecture & Engineering Review
|
||||||
|
|
||||||
|
**Architecture · Code Analysis · Engineering Verdict**
|
||||||
|
|
||||||
|
A guided walk through a native Win32 C++ speech-to-text app — how it's built, why it's built that way, and an honest assessment of the code for anyone picking it up for the first time.
|
||||||
|
|
||||||
|
| **~3,400** lines C++ (app) | **Win32** + GDI+ + SDL2 + whisper.cpp | **Single .exe**, no runtime deps | **Target** 2-core i5, CPU-only |
|
||||||
|
|---|---|---|---|---|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Contents
|
||||||
|
|
||||||
|
| # | Section |
|
||||||
|
|---|---------|
|
||||||
|
| 01 | [The verdict, up front](#01-the-verdict-up-front) |
|
||||||
|
| 02 | [Stack at a glance](#02-stack-at-a-glance) |
|
||||||
|
| 03 | [Architecture & data flow](#03-architecture--data-flow) |
|
||||||
|
| 04 | [The defining decision](#04-the-defining-decision) |
|
||||||
|
| 05 | [Threading model](#05-threading-model) |
|
||||||
|
| 06 | [Source map, file by file](#06-source-map-file-by-file) |
|
||||||
|
| 07 | [Deep dive: the UI engine](#07-deep-dive-the-ui-engine) |
|
||||||
|
| 08 | [Deep dive: the progress estimator](#08-deep-dive-the-progress-estimator) |
|
||||||
|
| 09 | [Deep dive: the transcriber](#09-deep-dive-the-transcriber) |
|
||||||
|
| 10 | [History, downloads & persistence](#10-history-downloads--persistence) |
|
||||||
|
| 11 | [Anatomy of one dictation](#11-anatomy-of-one-dictation) |
|
||||||
|
| 12 | [What's done well](#12-whats-done-well) |
|
||||||
|
| 13 | [What holds it back](#13-what-holds-it-back) |
|
||||||
|
| 14 | [Recommendations](#14-recommendations) |
|
||||||
|
| 15 | [Scorecard & final word](#15-scorecard--final-word) |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 01 The verdict, up front
|
||||||
|
|
||||||
|
### Bottom line
|
||||||
|
|
||||||
|
**A genuinely strong, characterful single-purpose tool that punches well above hobby grade.**
|
||||||
|
|
||||||
|
The hard engineering — the architecture choice, the self-calibrating progress estimator, the seam-free single-surface renderer — is thoughtful and well-executed. The app does exactly one thing and does it well on hardware most tools would choke on.
|
||||||
|
|
||||||
|
What holds it back is **organizational debt, not algorithmic weakness**: a 1,500-line `main.cpp`, a layer of vestigial child-window controls left over from an earlier design, and a pile of stale documentation that describes a GPU-streaming app this no longer is. None of it breaks the running product — but all of it raises the cost of the next person walking in.
|
||||||
|
|
||||||
|
*The sections below back up every part of that judgement with specifics from the source.*
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 02 Stack at a glance
|
||||||
|
|
||||||
|
Deliberately lean. No UI framework, no managed runtime, no garbage collector — just the OS and three libraries.
|
||||||
|
|
||||||
|
| Layer | Choice |
|
||||||
|
|-------|--------|
|
||||||
|
| **Language** | C++ *(MSVC, Release /O2 /GL /LTCG, AVX2/FMA/F16C)* |
|
||||||
|
| **UI** | Raw Win32 + GDI+ *(immediate-mode painted surface)* |
|
||||||
|
| **Audio capture** | SDL2 *(16 kHz mono, F32)* |
|
||||||
|
| **Inference** | whisper.cpp *(whisper_full, CPU backend)* |
|
||||||
|
| **Networking** | WinHTTP *(model downloads, system proxy aware)* |
|
||||||
|
| **Persistence** | Plain INI + UTF-8 text files *(no database)* |
|
||||||
|
| **Build** | CMake *(+ a PowerShell convenience script)* |
|
||||||
|
| **Footprint** | One .exe + a few DLLs + model *(tiny RAM, no install)* |
|
||||||
|
|
||||||
|
The whole product is native code with no framework abstraction between it and the Win32 API. That's the source of both its biggest strength (a tiny, fast, dependency-light binary) and its biggest cost (everything is hand-rolled, including the widgets).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 03 Architecture & data flow
|
||||||
|
|
||||||
|
A linear pipeline with a single inference step. Audio in, text out, no streaming loop.
|
||||||
|
|
||||||
|
```
|
||||||
|
┌────────┐ ┌────────┐ ┌────────┐ ┌────────────┐ ┌──────────┐
|
||||||
|
│ Hotkey │→ │ SDL2 │→ │PCM in │→ │whisper_full│→ │ Insert + │
|
||||||
|
│ trigger│ │ mic │ │ RAM │ │ worker │ │ paste │
|
||||||
|
└────────┘ └────────┘ └────────┘ └────────────┘ └──────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Hotkey** — Global `RegisterHotKey`. Captures the previously focused window.
|
||||||
|
- **SDL2 mic** — 16 kHz mono into an in-memory buffer. Near-zero CPU.
|
||||||
|
- **PCM in RAM** — Accumulated under a mutex; RMS energy tracked for the meter.
|
||||||
|
- **whisper_full** — One pass on a worker thread when you stop. Trim → transcribe → clean.
|
||||||
|
- **Insert + paste** — Text to caret, to clipboard, into the prior window.
|
||||||
|
|
||||||
|
Two side channels run alongside the main pipeline: a **progress estimator** that predicts and smooths the transcription countdown, and a **timing model** that learns this machine's speed and feeds back into the next prediction. Results return to the UI thread exclusively via `PostMessage`; shared flags are `std::atomic`.
|
||||||
|
|
||||||
|
> **Mental model**
|
||||||
|
>
|
||||||
|
> Think of it as a tape recorder with a transcription button, not a live captioner. The architecture has no per-frame transcription loop at all — which, on a 2-core CPU, is the whole point.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 04 The defining decision
|
||||||
|
|
||||||
|
The single most important thing to understand: this app was rebuilt from a live-streaming design into a push-to-talk batch design — and that was the right call.
|
||||||
|
|
||||||
|
An earlier version used the classic whisper.cpp streaming approach: a rolling 5–6 second window re-transcribed every ~0.4 seconds. That technique *assumes* spare cores. On the target machine — an Intel i5-7th-gen with two physical cores — the buffer backlogged, audio was re-transcribed, and the UI starved. The symptom looked like "the model is slow"; the real cause was an architecture that needed hardware the target didn't have.
|
||||||
|
|
||||||
|
The fix wasn't a faster model. It was removing the streaming loop entirely:
|
||||||
|
|
||||||
|
| Aspect | Old: streaming window | New: push-to-talk batch |
|
||||||
|
|--------|----------------------|--------------------------|
|
||||||
|
| CPU while speaking | Pinned — constant re-inference | Near idle — just buffering |
|
||||||
|
| Inference calls | Many per second | Exactly one, on stop |
|
||||||
|
| Accuracy | Lower — partial context windows | Higher — full clip, full context |
|
||||||
|
| UI responsiveness | Starved under load | Free until the single pass |
|
||||||
|
| Predictability | Variable lag | Predictable few-second wait |
|
||||||
|
|
||||||
|
This is textbook root-cause engineering: the team correctly diagnosed that the bottleneck was the *shape* of the work, not its size, and changed the shape. Everything else in the codebase — the batch worker, the progress estimator, the physical-core thread default — follows from this one decision.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 05 Threading model
|
||||||
|
|
||||||
|
Four threads, one rule: only the UI thread touches the UI. Everything else reports back by message.
|
||||||
|
|
||||||
|
| Thread | Lifetime | Job |
|
||||||
|
|--------|----------|-----|
|
||||||
|
| **UI thread** | Whole app | Message loop, all painting, the 16 ms animation timer and 50 ms update timer. |
|
||||||
|
| **Model preload** | Detached, once | Loads the Whisper context off the UI thread at startup so the window appears instantly. |
|
||||||
|
| **Transcribe worker** | Per clip | Runs `whisper_full`; posts `WM_APP_PROGRESS` during and `WM_APP_RESULT` when done. |
|
||||||
|
| **Downloader** | Per download | WinHTTP fetch on its own thread; posts `WM_APP_DLPROGRESS`. |
|
||||||
|
|
||||||
|
Cross-thread state is handled with discipline rather than locks where possible: `std::atomic` booleans (`m_recording`, `m_busy`, `m_abort`, `g_modelLoaded`, `g_modelOk`) gate state transitions, and the only shared buffer — the captured PCM — is protected by a dedicated mutex. The audio callback (driven by SDL's own thread) appends under that mutex; `stop_and_transcribe` swaps the buffer out under the same lock before handing it to the worker. That swap-not-copy handoff is a nice touch.
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
// transcriber.cpp — physical cores, not logical, by design
|
||||||
|
int Transcriber::default_threads() {
|
||||||
|
unsigned hc = std::thread::hardware_concurrency();
|
||||||
|
if (hc <= 2) return (int)std::max(1u, hc);
|
||||||
|
return (int)(hc / 2); // 4 logical → 2 worker threads
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Defaulting to physical cores rather than `hardware_concurrency()` is the correct choice for compute-bound SIMD inference — hyperthreads contend for the same execution units and would only add scheduling overhead.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 06 Source map, file by file
|
||||||
|
|
||||||
|
The app is small and mostly header-only outside the two big translation units. Here's where everything lives.
|
||||||
|
|
||||||
|
| File | Role | Notes |
|
||||||
|
|------|------|-------|
|
||||||
|
| `main.cpp` | Window, painting, interaction, settings view, clipboard, paste, model selection, popups | ~1,500 lines. The monolith — see §13. |
|
||||||
|
| `transcriber.{h,cpp}` | SDL capture, Whisper preload/inference, progress & abort callbacks | Clean, well-scoped class. The model layer. |
|
||||||
|
| `timing.h` | Per-model least-squares timing model + live progress estimator + INI persistence | The standout module. See §08. |
|
||||||
|
| `history.h` | Session text files, UTF-8 r/w with BOM, index, pruning to 100 | Self-contained, header-only. |
|
||||||
|
| `downloader.h` | WinHTTP model downloader on a background thread | `.part` + atomic rename, cancel, proxy-aware. |
|
||||||
|
| `stats.h` | Lifetime usage totals + derived figures (wpm, real-time factor, time saved) | INI-backed, header-only. |
|
||||||
|
| `settings.h` | App settings read/write via `GetPrivateProfile*` | Simple and transparent. |
|
||||||
|
| `text_util.h` · `logging.h` | Transcript concatenation; timestamped file log | Tiny helpers. |
|
||||||
|
| `tests/test_core.cpp` | Unit checks: append logic, bad-model handling, real-WAV transcription, progress monotonicity | Modest but meaningful. Built as `test-core`. |
|
||||||
|
|
||||||
|
The decision to make most subsystems **header-only and independent** (`timing.h`, `stats.h`, `history.h`, `downloader.h`, `settings.h`) is a good one for a project this size: each is cohesive, individually readable, and free of cross-dependencies. The contrast with `main.cpp` — which absorbs everything else — is stark.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 07 Deep dive: the UI engine
|
||||||
|
|
||||||
|
There are no buttons. Everything you see is painted onto one double-buffered surface — and that's a deliberate fix, not a shortcut.
|
||||||
|
|
||||||
|
The previous UI composited around nine separate themed child windows (buttons, statics, an edit). That produced thin hairline seams around every control — the hard-edged holes `WS_CLIPCHILDREN` punches per child, plus the edit's themed border. Rather than chase pixel borders, the rebuild eliminated the cause: **collapse the controls into one painted region.**
|
||||||
|
|
||||||
|
The model is a small immediate-mode system:
|
||||||
|
|
||||||
|
- A flat `Widget g_w[]` array — each entry is a *kind*, a rectangle, and `hover/pressed/anim` state. No HWNDs.
|
||||||
|
- `LayoutWidgets()` positions them; `PaintSurface()` draws each into an off-screen DC with GDI+, then blits once (no flicker).
|
||||||
|
- `HitTest()` maps a click point to a widget; `OnClick()` dispatches the action.
|
||||||
|
- An animation clock eases each widget's `anim` toward a target (hover 0.6, active 1.0) on a 16 ms timer that *stops itself* when nothing is moving — no idle CPU burn.
|
||||||
|
|
||||||
|
Two "views" — Main and Settings — render onto the same surface, toggled by `SwitchView()`. Dropdowns (mic, history) are the one exception: they're real top-level `WS_POPUP` windows, because a surface-painted dropdown would render *behind* the transcript edit (a child HWND always paints above its parent's surface). That's a correct, well-reasoned exception.
|
||||||
|
|
||||||
|
> **A sign of maturity**
|
||||||
|
>
|
||||||
|
> The popup code carries a comment never to open a `MessageBox` from inside it — because `WA_INACTIVE` self-destroys the popup mid-handler, causing a use-after-free. Recognising that class of Win32 lifetime bug, and the GDI+ "`GetHDC` locks the Graphics object" trap documented elsewhere, shows real depth.
|
||||||
|
|
||||||
|
The one real child window that survives is the transcript `EDIT` — kept because a hand-rolled text editor with selection, scrolling, IME and undo is genuinely not worth rebuilding. Pragmatic.
|
||||||
|
|
||||||
|
### The cost of this approach
|
||||||
|
|
||||||
|
Custom-painted controls are invisible to screen readers and UI Automation, and the app explicitly hides focus rectangles. The transcript box is accessible; the buttons are not. For a personal productivity tool this is a defensible trade, but it's the kind of thing worth stating out loud.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 08 Deep dive: the progress estimator
|
||||||
|
|
||||||
|
The crown jewel. Most apps fake a progress bar; this one runs a small statistical model that learns your machine.
|
||||||
|
|
||||||
|
Whisper only reports coarse progress (per 30-second chunk), so a naive bar jumps — 0, 34, 72, 100 — and a naive "time left" computed from stale percentages actually counts *up*. `timing.h` solves both. It has two parts.
|
||||||
|
|
||||||
|
### 1 — A learned timing model
|
||||||
|
|
||||||
|
Processing time is modelled as a linear function of audio length, `proc = a + b·audio`, fitted by **decayed online least-squares**. Each completed transcription feeds back a real sample; older samples decay (factor 0.97) so the model tracks the current machine state. Defaults are seeded per model family (tiny/base/small) so even the very first clip has a sane estimate, and the accumulators persist per-model in the INI.
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
void add_sample(double audio_sec, double proc_sec) {
|
||||||
|
const double decay = 0.97;
|
||||||
|
n*=decay; sx*=decay; sy*=decay; sxx*=decay; sxy*=decay;
|
||||||
|
n+=1; sx+=audio_sec; sy+=proc_sec;
|
||||||
|
sxx+=audio_sec*audio_sec; sxy+=audio_sec*proc_sec;
|
||||||
|
recompute(); // closed-form slope/intercept
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2 — A live estimator that only counts down
|
||||||
|
|
||||||
|
On stop, `begin(predict)` seeds a predicted total. As Whisper reports chunk progress, `on_whisper()` folds it in as a *measurement* via an EMA (α = 0.5) — nudging the estimate without the jumpy jumps. Meanwhile `tick()` advances a displayed "remaining" value that is **strictly monotonic downward**, with a clamped catch-up rate so it can speed up but never lurch backward, easing to 95% and snapping to 100% only on the real result.
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
void tick(double dt, float& out_frac, float& out_remaining) {
|
||||||
|
t += dt; disp_rem -= dt;
|
||||||
|
double raw_rem = std::max(0.0, T_hat - t);
|
||||||
|
double err = raw_rem - disp_rem;
|
||||||
|
if (err < 0) disp_rem += std::max(err, -maxCatchUp*dt); // catch up, never jump back
|
||||||
|
double frac = t/(t+disp_rem);
|
||||||
|
if (frac > 0.95) frac = 0.95; // park at 95% until done
|
||||||
|
out_frac = (float)frac; out_remaining = (float)disp_rem;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This is more thought than most commercial apps put into a progress bar, and the test suite even asserts the progress is non-decreasing. It's the clearest signal in the codebase that someone cared about the *feel* of the product, not just its function.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 09 Deep dive: the transcriber
|
||||||
|
|
||||||
|
The cleanest class in the project — a tidy boundary between the OS/model and the rest of the app.
|
||||||
|
|
||||||
|
`Transcriber` owns the Whisper context and the SDL device, and exposes a small, sensible surface: `preload`, `reload`, `start_recording`, `stop_and_transcribe`, `cancel`, plus state queries and two callbacks (`result`, `progress`). Inference parameters are configured sensibly for dictation — greedy sampling, no timestamps, no prior context, blank/non-speech suppression, temperature 0 — and an `abort_callback` lets a long transcription be cancelled mid-flight.
|
||||||
|
|
||||||
|
Two small details worth calling out:
|
||||||
|
|
||||||
|
- **Silence trimming.** Before inference, leading/trailing silence is trimmed from the clip — cheaper and more accurate than transcribing dead air. (Note: this trims the *buffer*; it does not auto-stop recording — see the doc-drift note in §13.)
|
||||||
|
- **Output cleanup.** `clean_text()` strips Whisper's `[BLANK_AUDIO]` / `[NOISE]` artifacts and trims whitespace, so the user never sees model noise.
|
||||||
|
|
||||||
|
The class is also defensively coded: a missing model file makes `preload` return false cleanly (the test suite verifies this), `start_recording` bails if a device won't open, and clips under ~0.3 s short-circuit to an empty result rather than invoking the model.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 10 History, downloads & persistence
|
||||||
|
|
||||||
|
No database, no registry sprawl — everything is a file next to the executable. Transparent and portable.
|
||||||
|
|
||||||
|
### Session history
|
||||||
|
|
||||||
|
Each session is one UTF-8 text file in `history\`, named by timestamp. The clever bit is *live* archiving: the first clip of a session creates the file; subsequent clips rewrite the *same* file with the full text. So a session is always one tidy, crash-safe file — not a scatter of fragments — and it appears in the History popup immediately. A `g_sessionPath` global plus a `FinalizeSession()` helper handle the edge cases (manual edits, typed-only sessions, loading an old entry without resurrecting it). The list is capped at 100 with automatic pruning.
|
||||||
|
|
||||||
|
> **A real bug was fixed here**
|
||||||
|
>
|
||||||
|
> An earlier version stamped every fresh transcription as "loaded from history," so the duplicate-guard silently skipped archiving — sessions never reached disk while the UI claimed "Saved." The fix (live archiving + a corrected guard) is documented and shows the team chasing subtle state bugs to ground.
|
||||||
|
|
||||||
|
### Model downloads
|
||||||
|
|
||||||
|
The downloader is more robust than it needed to be, in a good way: it streams to a `.part` file then does an atomic rename on success (no half-files), honors the system proxy, follows the Hugging Face → CDN redirects, supports cancellation, allows only one download at a time, and sweeps up stray `.part` files at startup.
|
||||||
|
|
||||||
|
### Settings, timing & stats
|
||||||
|
|
||||||
|
All three live in a single `win-dictation.ini` under different sections — app settings, per-model timing accumulators, and lifetime stats. Using the OS's own `GetPrivateProfile*` API means zero parsing code and a file a user can read and edit by hand. For an app of this scope, that's exactly the right level of machinery.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 11 Anatomy of one dictation
|
||||||
|
|
||||||
|
Following a single clip end-to-end ties the whole system together.
|
||||||
|
|
||||||
|
1. `WM_HOTKEY` fires → the app records `g_prevForeground` and the current selection (`EM_GETSEL`) so it knows where to paste and where to insert.
|
||||||
|
2. `g_tx.start_recording()` opens the SDL device; the audio callback appends PCM under the capture mutex and updates the RMS energy meter.
|
||||||
|
3. The 50 ms UI timer animates the level meter and ticks the on-screen recording clock.
|
||||||
|
4. Second `WM_HOTKEY` → `g_est.begin(g_timing.predict(len))` seeds the progress estimate; `g_tx.stop_and_transcribe()` swaps the buffer to a worker thread.
|
||||||
|
5. The worker runs `run_inference()` → `whisper_full`. Whisper's progress callback posts `WM_APP_PROGRESS`; the estimator's `on_whisper()` EMA-folds it in.
|
||||||
|
6. On completion the worker posts `WM_APP_RESULT`.
|
||||||
|
7. The UI thread then, in order: snaps progress to 100%, records a real timing sample (`add_sample` + `SaveTiming`), updates lifetime stats, inserts the text at the saved caret with smart spacing via `EM_REPLACESEL` (undoable), archives the session, copies to the clipboard, and pastes into `g_prevForeground`.
|
||||||
|
|
||||||
|
Every piece of the architecture shows up in that one trip: the atomics, the message hand-back, the estimator, the learned timing feedback loop, the editable transcript, the live history. It's a coherent design.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 12 What's done well
|
||||||
|
|
||||||
|
- ✅ **The architecture fits the hardware** — Push-to-talk batch over streaming is the correct response to a 2-core CPU, reached by genuine root-cause analysis rather than knob-twiddling.
|
||||||
|
|
||||||
|
- ✅ **The progress estimator is exceptional** — Decayed online least-squares + EMA fusion + a strictly monotonic countdown is far beyond what the task demanded — and it shows in the feel.
|
||||||
|
|
||||||
|
- ✅ **Seam-free UI by elimination, not patching** — Collapsing nine child windows into one painted, double-buffered, DPI-aware, self-throttling surface removed the problem at its source.
|
||||||
|
|
||||||
|
- ✅ **Clean module boundaries (outside main)** — Header-only, dependency-free subsystems (timing, history, downloader, stats, settings) are each individually readable and testable.
|
||||||
|
|
||||||
|
- ✅ **Robustness in the right places** — Atomic rename downloads, crash-safe live history, graceful missing-model handling, cancellable inference, single-instance mutex, model preload off the UI thread.
|
||||||
|
|
||||||
|
- ✅ **Real product thoughtfulness** — Smart insertion spacing, undoable edits, auto-paste into the prior window, auto-hide, learned timing, friendly stats. These are details a careful builder adds.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 13 What holds it back
|
||||||
|
|
||||||
|
All fixable, and none of it affects the running app. But it's exactly what a newcomer trips over.
|
||||||
|
|
||||||
|
### ⚠ `main.cpp` is a 1,500-line god object
|
||||||
|
|
||||||
|
UI, layout, painting, the entire settings screen, clipboard, paste mechanics, model selection, the popup window class, and stats formatting all live in one translation unit with dozens of globals. It works, but it's the hardest part of the codebase to onboard into. Splitting the settings view, the popup, and the painting helpers into their own files would pay for itself quickly.
|
||||||
|
|
||||||
|
### ⚠ Vestigial child windows & duplicate code paths
|
||||||
|
|
||||||
|
Startup still creates ~9 owner-draw child controls (record, pin, copy, paste, clear, two selects, two statics) and then immediately hides all but the transcript edit. Their dead `WM_COMMAND` handlers duplicate the painted-widget `OnClick` logic — e.g. the Copy action exists in two near-identical places. Leftovers from the rebuild that should be deleted.
|
||||||
|
|
||||||
|
*main.cpp — `CreateWindow(...)` blocks then `ShowWindow(..., SW_HIDE)`*
|
||||||
|
|
||||||
|
### ❌ Documentation describes a different app
|
||||||
|
|
||||||
|
This is the most actively misleading issue. `CUDA-SETUP.md`, `QUICK-REBUILD-GPU.md` and `FIXES-APPLIED.md` describe a streaming, VAD, ring-buffer, 24-thread, RTX 3090 design that no longer exists. `build.ps1` still hunts for CUDA and downloads `base.en` though the product is a CPU-only `tiny.en` app. `TESTING.md` references a `test-audio.exe` the CMake doesn't build (it builds `test-core`). A newcomer reading the docs would form a completely wrong mental model.
|
||||||
|
|
||||||
|
### ❌ The README claims a feature that isn't there
|
||||||
|
|
||||||
|
Both `README.md` and `CHANGES.md` describe a "500 ms silence auto-end timer." The recording loop has no such logic — it only auto-stops at the 10-minute safety cap. (Silence is *trimmed* before inference, which is likely the source of the confusion.) Either implement it or remove the claim.
|
||||||
|
|
||||||
|
*main.cpp `WM_TIMER` recording branch vs README "Audio Processing"*
|
||||||
|
|
||||||
|
### ⚠ Heavy reliance on global mutable state
|
||||||
|
|
||||||
|
The UI is coordinated through dozens of file-scope globals (`g_*`), a mix of atomics and plain values. It's manageable at this size and the threading is disciplined, but it makes the code hard to reason about in isolation and easy to break with a careless edit.
|
||||||
|
|
||||||
|
### ⚠ Build declares C++11 but uses C++17
|
||||||
|
|
||||||
|
`CMakeLists.txt` sets `CMAKE_CXX_STANDARD 11`, yet the code uses `std::size()` (C++17). It compiles only because MSVC's default is newer. Set the standard to 17 explicitly so the build is honest and portable.
|
||||||
|
|
||||||
|
### ⚠ Minor: redundant color systems & no in-app hotkey editor
|
||||||
|
|
||||||
|
Three overlapping palettes coexist (`CR_*` COLORREF, `T_*` GDI+ Color, `C_*` aliases). And changing the hotkey requires hand-editing the INI — a natural gap given the polished Settings screen already exists.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 14 Recommendations
|
||||||
|
|
||||||
|
If the next session had a short to-do list, this would be it — ordered by payoff for effort.
|
||||||
|
|
||||||
|
| # | Task | Priority |
|
||||||
|
|---|------|----------|
|
||||||
|
| 1 | **Purge or archive the stale docs** — Delete or clearly mark `CUDA-SETUP.md`, `QUICK-REBUILD-GPU.md`, `FIXES-APPLIED.md`, `TESTING.md` and `DESIGN.md` as describing the retired streaming design. This is the single biggest improvement to onboarding, and it's nearly free. | **High** |
|
||||||
|
| 2 | **Reconcile the README with reality** — Remove the "500 ms silence auto-end" claim (or implement it). Update the model table and build commands to match the CPU-only product. | **High** |
|
||||||
|
| 3 | **Delete the vestigial child windows** — Remove the hidden owner-draw controls and their dead `WM_COMMAND` handlers so there's exactly one code path per action. De-duplicate Copy. | Medium |
|
||||||
|
| 4 | **Break up `main.cpp`** — Lift the Settings view, the popup window, and the GDI+ drawing helpers into their own files. Even a mechanical split dramatically improves navigability. | Medium |
|
||||||
|
| 5 | **Fix the build standard & align `build.ps1`** — Set `CMAKE_CXX_STANDARD 17`. Strip the CUDA detection from the build script and default it to fetching `tiny.en`. | Medium |
|
||||||
|
| 6 | **Add an in-app hotkey picker** — The Settings surface already exists; surfacing the hotkey there closes an obvious UX gap and removes a troubleshooting step. | Low |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 15 Scorecard & final word
|
||||||
|
|
||||||
|
| Category | Score |
|
||||||
|
|----------|-------|
|
||||||
|
| Architecture & design | █████████░░ 9.2 |
|
||||||
|
| Performance fit for target | █████████░░ 9.3 |
|
||||||
|
| UX & polish | ████████░░░ 8.7 |
|
||||||
|
| Robustness & error handling | ███████░░░░ 7.5 |
|
||||||
|
| Code organization | █████░░░░░░ 5.5 |
|
||||||
|
| Maintainability | █████░░░░░░ 5.8 |
|
||||||
|
| Testing | ████░░░░░░░ 4.8 |
|
||||||
|
| Documentation accuracy | ███░░░░░░░░ 3.8 |
|
||||||
|
|
||||||
|
### Overall: 7.1 / 10 — Strong, with cleanup debt.
|
||||||
|
|
||||||
|
An impressive core wrapped in organizational and documentation drift. The engineering earns a high mark; the housekeeping pulls the average down.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Final word
|
||||||
|
|
||||||
|
Win Dictation is a **good codebase — at its core, an impressive one**. The architectural judgement (batch over streaming), the standout progress estimator, and the seam-free renderer are the work of someone who diagnoses root causes and cares about how software feels. Those are the hard parts, and they're done right.
|
||||||
|
|
||||||
|
What separates it from "great" is entirely recoverable: a monolithic main file, dead code from a prior design, and documentation that actively describes a different application. A focused day of cleanup — most of it deletion — would lift this from "strong for its niche" to "exemplary small-app code." The good news for anyone inheriting it: the bones are excellent, and the to-do list is short.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*Win Dictation — Architecture & Engineering Review*
|
||||||
|
*Native Win32 C++ · GDI+ · SDL2 · whisper.cpp · CPU-only · target Intel i5-7th-gen (2C/4T)*
|
||||||
|
*Assessment based on a full read of the current source tree.*
|
||||||
@@ -0,0 +1,313 @@
|
|||||||
|
# Win Dictation — User Manual
|
||||||
|
|
||||||
|
**v3** · Offline · Hotkey `Ctrl+Shift+Space` · CPU-only · Whisper `tiny.en` → `small.en`
|
||||||
|
|
||||||
|
A push-to-talk speech-to-text utility for Windows. Press a hotkey, speak, and your words land in whatever app you were just using — fully offline, powered by Whisper.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Contents
|
||||||
|
|
||||||
|
| # | Section |
|
||||||
|
|---|---------|
|
||||||
|
| 01 | [What Win Dictation is](#01-what-win-dictation-is) |
|
||||||
|
| 02 | [Quick start in 60 seconds](#02-quick-start-in-60-seconds) |
|
||||||
|
| 03 | [The interface, explained](#03-the-interface-explained) |
|
||||||
|
| 04 | [How dictation works](#04-how-dictation-works) |
|
||||||
|
| 05 | [Keyboard & hotkeys](#05-keyboard--hotkeys) |
|
||||||
|
| 06 | [Auto-paste & the active window](#06-auto-paste--the-active-window) |
|
||||||
|
| 07 | [History & sessions](#07-history--sessions) |
|
||||||
|
| 08 | [Models & the Settings screen](#08-models--the-settings-screen) |
|
||||||
|
| 09 | [System tray & options](#09-system-tray--options) |
|
||||||
|
| 10 | [Your statistics](#10-your-statistics) |
|
||||||
|
| 11 | [Tips for best results](#11-tips-for-best-results) |
|
||||||
|
| 12 | [Troubleshooting](#12-troubleshooting) |
|
||||||
|
| 13 | [FAQ & where things live](#13-faq--where-things-live) |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 01 What Win Dictation is
|
||||||
|
|
||||||
|
A small, focused desktop tool that turns your voice into text anywhere on Windows — no browser, no cloud, no account.
|
||||||
|
|
||||||
|
Win Dictation sits quietly in your system tray. When you want to dictate, you press a global hotkey, speak a sentence or a paragraph, then press the hotkey again. A second or two later the transcribed text is copied to your clipboard and — by default — automatically pasted into whatever window you were using: your email, a chat box, a code editor, a document.
|
||||||
|
|
||||||
|
Everything happens **on your computer**. The audio never leaves the machine; transcription runs locally using [whisper.cpp](https://github.com/ggerganov/whisper.cpp), a compact build of OpenAI's Whisper model. That means it works on a plane, behind a firewall, or anywhere with no internet at all.
|
||||||
|
|
||||||
|
> **Built for modest hardware**
|
||||||
|
>
|
||||||
|
> This build is tuned for an ordinary CPU-only laptop — the kind with two physical cores and no graphics card. It uses a fast, lightweight model by default and keeps your processor nearly idle while you speak, only working hard for a brief moment after you stop.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 02 Quick start in 60 seconds
|
||||||
|
|
||||||
|
Three steps. No setup, no sign-in.
|
||||||
|
|
||||||
|
### Step 1 — Launch `win-dictation.exe`
|
||||||
|
|
||||||
|
The window opens and a microphone icon appears in your system tray. Wait a moment for the status line to change from *"Loading model…"* to **"Ready"**.
|
||||||
|
|
||||||
|
### Step 2 — Click into wherever you want the text, then press `Ctrl`+`Shift`+`Space`
|
||||||
|
|
||||||
|
Put your cursor in the email, chat box, or document first. Then hit the hotkey. The Record button turns red and a green level meter shows it's hearing you.
|
||||||
|
|
||||||
|
### Step 3 — Speak, then press the hotkey again
|
||||||
|
|
||||||
|
Talk naturally. When you're done, press `Ctrl`+`Shift`+`Space` once more. A short progress bar runs, and your words appear — pasted straight into the app you were using.
|
||||||
|
|
||||||
|
> That's the whole loop: press to start, speak, press to finish. The text is on your clipboard *and* dropped into your previous window. You never have to click back into Win Dictation.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 03 The interface, explained
|
||||||
|
|
||||||
|
The whole app is a single window. Here is every control on it.
|
||||||
|
|
||||||
|
```
|
||||||
|
┌────────────────────────────────────┐
|
||||||
|
│ Dictation — □ ✕│
|
||||||
|
├────────────────────────────────────┤
|
||||||
|
│ ╭─────────────────────────╮ │
|
||||||
|
│ │ ● Record [1] │ [2][3]│
|
||||||
|
│ ╰─────────────────────────╯ │
|
||||||
|
│ Ready · 2 threads [4] │
|
||||||
|
│ ┌────────────────────────────┐ │
|
||||||
|
│ │ Win-dictate is a desktop, │ │
|
||||||
|
│ │ whisper powered, speech to │ │
|
||||||
|
│ │ text application! [5] │ │
|
||||||
|
│ └────────────────────────────┘ │
|
||||||
|
│ ┌─────────────────┐ ┌───────┐ │
|
||||||
|
│ │ Microphone ... │ │History│ │
|
||||||
|
│ └─────────────────┘ └───────┘ │
|
||||||
|
│ [6] [7] │
|
||||||
|
│ Copy Paste Clear [8] │
|
||||||
|
└────────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
| # | Control | Description |
|
||||||
|
|---|---------|-------------|
|
||||||
|
| 1 | **Record / Stop** | The big pill. Click to start; it turns red and reads "Stop" while recording. Same as the hotkey. |
|
||||||
|
| 2 | **Pin** | Keeps the window always on top. Blue when active. On by default. |
|
||||||
|
| 3 | **Settings (cog)** | Opens the Settings screen for choosing and downloading models, and viewing your stats. |
|
||||||
|
| 4 | **Status line** | Shows "Ready" and the thread count when idle, a timer while recording, and a live countdown while transcribing. |
|
||||||
|
| 5 | **Transcript box** | Where text appears. You can **edit it freely** — click in and type, fix, or delete. |
|
||||||
|
| 6 | **Microphone selector** | Choose which input device to record from. Opens a dropdown of all your mics. |
|
||||||
|
| 7 | **History** | Opens a list of past dictation sessions you can reload — or delete individually. |
|
||||||
|
| 8 | **Copy · Paste · Clear** | Copy the transcript, paste it into your last window, or clear the box (saving it to history first). |
|
||||||
|
|
||||||
|
### The status line is your dashboard
|
||||||
|
|
||||||
|
That one line of dim text under the Record button tells you everything about the app's state:
|
||||||
|
|
||||||
|
| You see | It means |
|
||||||
|
|---------|----------|
|
||||||
|
| `Loading model…` | Starting up — the speech model is being read into memory. Wait a second. |
|
||||||
|
| `Ready · 2 threads` | Idle and ready to record. The number is how many CPU threads it will use. |
|
||||||
|
| `Recording 0:14` | Listening. The timer counts how long you've been speaking. A green level meter pulses with your voice. |
|
||||||
|
| `Transcribing 0:14 · 62% · 3s left` | Working on your audio. The bar fills and the countdown ticks *down* to zero. |
|
||||||
|
| `Pasted` / `Copied` | Done. Your text went to the clipboard (and into your previous window if auto-paste is on). |
|
||||||
|
| `No speech detected` | The clip was silent or too short to transcribe. Nothing was added. |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 04 How dictation works
|
||||||
|
|
||||||
|
Win Dictation is **push-to-talk**, not live streaming. You record a whole clip, then it transcribes the whole thing at once.
|
||||||
|
|
||||||
|
This is a deliberate design choice. Instead of trying to transcribe word-by-word as you speak (which pins a CPU at 100% and stutters on a modest laptop), Win Dictation simply records your audio cheaply while you talk, then does one fast transcription pass the moment you stop. The result is calmer, more accurate, and far lighter on your battery.
|
||||||
|
|
||||||
|
### What happens when you record
|
||||||
|
|
||||||
|
1. **You press the hotkey.** The app remembers which window you were in, and where your text cursor was sitting inside the transcript box.
|
||||||
|
2. **It records.** Audio is captured at 16 kHz and held in memory. CPU use stays near zero. The level meter shows it's hearing you.
|
||||||
|
3. **You press the hotkey again.** Recording stops. Silence at the start and end of your clip is trimmed away automatically.
|
||||||
|
4. **It transcribes.** The full clip is run through Whisper once. The progress bar shows a smooth, self-calibrating estimate of how long it will take.
|
||||||
|
5. **The text lands.** It's inserted at your cursor (with smart spacing so words don't run together), copied to the clipboard, and pasted into your previous window.
|
||||||
|
|
||||||
|
> **There is no "stop on silence"**
|
||||||
|
>
|
||||||
|
> Recording continues until *you* press the hotkey again (or click Stop). Pausing to think won't end the session — take your time. The only automatic stop is a safety cap at **10 minutes** per clip.
|
||||||
|
|
||||||
|
### The transcript box is editable
|
||||||
|
|
||||||
|
Unlike many dictation tools, the text area is fully editable. Click anywhere in it to fix a misheard word, delete a stray sentence, or type manually. When you dictate again, the new text is inserted **at your cursor** — so you can build up a document piece by piece, placing each new chunk exactly where you want it.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 05 Keyboard & hotkeys
|
||||||
|
|
||||||
|
Two global shortcuts work from anywhere in Windows, even when the window is hidden.
|
||||||
|
|
||||||
|
| Shortcut | Action |
|
||||||
|
|----------|--------|
|
||||||
|
| `Ctrl`+`Shift`+`Space` | **Start / stop recording.** The core hotkey. Press once to begin, once more to transcribe. If a transcription is already running, pressing it again cancels it. |
|
||||||
|
| `Ctrl`+`Shift`+`H` | **Hide the window.** Tucks Win Dictation away to the tray (and cancels any recording in progress). The hotkeys still work while hidden. |
|
||||||
|
| `Esc` *(in a dropdown)* | Closes an open Microphone or History popup without choosing anything. |
|
||||||
|
| `Delete` *(in History)* | Deletes the history entry you're hovering over. |
|
||||||
|
|
||||||
|
> **⚠ If the hotkey doesn't work**
|
||||||
|
>
|
||||||
|
> You may see `Hotkey in use — edit win-dictation.ini`. That means another program already grabbed `Ctrl`+`Shift`+`Space`. You can change it by editing the `hkMods` and `hkVk` values in the `win-dictation.ini` file (see the [FAQ](#13-faq--where-things-live)).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 06 Auto-paste & the active window
|
||||||
|
|
||||||
|
The feature that makes Win Dictation feel invisible: it types into *other* apps for you.
|
||||||
|
|
||||||
|
When you trigger recording, the app notes which window had focus a moment before. After transcription, if **Auto-paste** is enabled (it is by default), it brings that window back to the front and pastes your text there automatically. You dictate, and the words appear in your email — you never touch Win Dictation's own window.
|
||||||
|
|
||||||
|
If you'd rather paste manually, turn auto-paste off in the tray menu. The text is always still copied to your clipboard, and the **Paste** button will send it to your last window on demand.
|
||||||
|
|
||||||
|
> **Pair it with Auto-hide**
|
||||||
|
>
|
||||||
|
> Turn on **Auto-hide** (tray menu) and the window disappears the instant it pastes. Combined with the global hotkey, dictation becomes a pure overlay: tap, speak, tap, and your words flow into whatever you're doing.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 07 History & sessions
|
||||||
|
|
||||||
|
Every dictation session is saved automatically, so you never lose a transcript.
|
||||||
|
|
||||||
|
A **session** is everything you dictate between clears. As soon as you finish your first clip, Win Dictation writes it to a timestamped text file. Each additional clip in that session updates the same file — so one session is one tidy file, kept up to date as you go.
|
||||||
|
|
||||||
|
### Browsing and reloading
|
||||||
|
|
||||||
|
Click the **History** selector to open the list. Each entry shows its date, time, and a short preview of the text. Click one to load it back into the transcript box. The most recent sessions are at the top, and up to **100** sessions are kept (older ones are pruned automatically).
|
||||||
|
|
||||||
|
### Deleting entries
|
||||||
|
|
||||||
|
Hover over any history row and a small **✕** appears on its right edge — click it to delete that session's file. You can also press `Delete` on the hovered row. The list *stays open* after each delete so you can tidy up several at once. The window even shrinks to fit as the list gets shorter.
|
||||||
|
|
||||||
|
> **⚠ Deletion is permanent**
|
||||||
|
>
|
||||||
|
> Removing a history entry deletes its text file from disk immediately — there is no confirmation prompt and no undo. The files themselves live in a `history\` folder next to the program, if you ever want to back them up.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 08 Models & the Settings screen
|
||||||
|
|
||||||
|
A model is the AI that turns sound into words. Bigger models are more accurate but slower. Click the cog to manage them.
|
||||||
|
|
||||||
|
The Settings screen lists every model Win Dictation can use. Each row shows the model's name, file size, and a short hint. Installed models have a filled radio button you can select; ones you don't have yet show a **Download** button that fetches them directly from Hugging Face with a live progress percentage.
|
||||||
|
|
||||||
|
| Model | Size | Character | Speed |
|
||||||
|
|-------|------|-----------|-------|
|
||||||
|
| `tiny.en` | ~75 MB | The default. Quick and light — ideal for this CPU. | Fastest |
|
||||||
|
| `tiny.en-q8_0` | ~42 MB | Same speed, smaller file (compressed). | Fastest |
|
||||||
|
| `base.en-q5_1` | ~59 MB | A noticeable accuracy bump for little cost. | Good balance |
|
||||||
|
| `base.en` | ~142 MB | More accurate; still reasonable on two cores. | Balance |
|
||||||
|
| `small.en-q5_1` | ~182 MB | Accurate, but slow on this machine. | Slow |
|
||||||
|
| `small.en` | ~466 MB | The most accurate offered — and the slowest. | Slowest |
|
||||||
|
|
||||||
|
### Choosing a model
|
||||||
|
|
||||||
|
1. Open Settings (the cog), and find the model you want.
|
||||||
|
2. If it isn't installed, click **Download** and wait for it to reach 100%. You can cancel mid-download, and only one downloads at a time.
|
||||||
|
3. Click the model's row to select it (the dot fills in).
|
||||||
|
4. Click **Save**. The app reloads with the new model and remembers your choice. **Back** or **Cancel** discards any change.
|
||||||
|
|
||||||
|
> **A good rule of thumb**
|
||||||
|
>
|
||||||
|
> Stick with `tiny.en` or `base.en-q5_1` for everyday use on a two-core laptop. Step up to `base.en` if you want better accuracy and don't mind waiting a beat longer. The `small` models are best reserved for short, important clips where accuracy matters most.
|
||||||
|
|
||||||
|
### The progress bar learns your machine
|
||||||
|
|
||||||
|
You'll notice the transcription countdown is unusually accurate. That's because Win Dictation **measures how fast your specific computer is** with each model and remembers it. The more you use a model, the better its time estimates become — the bar counts steadily down rather than jumping around.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 09 System tray & options
|
||||||
|
|
||||||
|
Win Dictation lives in the tray. Right-click its icon for the quick options menu.
|
||||||
|
|
||||||
|
| Option | Description |
|
||||||
|
|--------|-------------|
|
||||||
|
| **Auto-paste** | Paste transcribed text into your previous window automatically. On by default. |
|
||||||
|
| **Always on top** | Keep the window above other apps. Mirrors the Pin button. On by default. |
|
||||||
|
| **Auto-hide** | Hide the window automatically right after it pastes. Off by default. |
|
||||||
|
| **Exit** | Fully quits the app. Closing the window only hides it to the tray — use this to stop it entirely. |
|
||||||
|
|
||||||
|
Double-clicking the tray icon brings the window back. Closing the window with the **✕** doesn't quit — it just hides, so the hotkey keeps working in the background. Your window position, pinned state, and these toggles are all remembered between launches.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 10 Your statistics
|
||||||
|
|
||||||
|
Scroll down in Settings to see a running tally of your dictation habits.
|
||||||
|
|
||||||
|
Win Dictation quietly keeps lifetime totals and turns them into friendly figures:
|
||||||
|
|
||||||
|
- **Total audio dictated** and the number of clips.
|
||||||
|
- **Word count**, plus your average **speaking pace** in words per minute.
|
||||||
|
- **Total processing time** and your machine's **real-time factor** (e.g. "4× real-time" means it transcribes four seconds of audio every second).
|
||||||
|
- Your **longest single clip**.
|
||||||
|
- An estimate of the **time you've saved** versus typing at 40 wpm.
|
||||||
|
|
||||||
|
These numbers are stored locally and are just for your own curiosity — nothing is reported anywhere.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 11 Tips for best results
|
||||||
|
|
||||||
|
- **Click first, then dictate** — Put your text cursor in the destination app *before* pressing the hotkey, so auto-paste knows where to send the words.
|
||||||
|
- **Speak in natural phrases** — Whisper transcribes best with full sentences and natural rhythm. You don't need to over-enunciate or pause between words.
|
||||||
|
- **Pick the right mic** — If accuracy is poor, check the Microphone selector — a headset or dedicated mic beats a distant laptop mic in a noisy room.
|
||||||
|
- **Match model to task** — Quick chat replies? `tiny.en`. A careful paragraph of prose? Try `base.en` for fewer corrections.
|
||||||
|
- **Edit in place** — Fix the odd misheard word right in the transcript box, then Copy — faster than re-recording the whole thing.
|
||||||
|
- **Let it warm up** — The very first transcription after launch can be a touch slower as the model settles into memory. It's quick from then on.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 12 Troubleshooting
|
||||||
|
|
||||||
|
| Symptom | What to do |
|
||||||
|
|---------|------------|
|
||||||
|
| **"Model not found"** | The selected `.bin` model file is missing. Open Settings and download a model (start with `tiny.en`), or place a `.bin` file in the `models\` folder next to the program and restart. |
|
||||||
|
| **"Hotkey in use"** | Another app owns `Ctrl`+`Shift`+`Space`. Change the hotkey in `win-dictation.ini`, or close the conflicting app. You can still record by clicking the Record button. |
|
||||||
|
| **"Microphone error"** | The chosen input device couldn't be opened. Pick a different mic from the selector, make sure it isn't in use by another app, and check Windows mic permissions. |
|
||||||
|
| **"No speech detected"** | The clip was silent, too quiet, or under ~0.3 seconds. Check the level meter moves when you talk, and confirm the right mic is selected. |
|
||||||
|
| **Text pasted into the wrong place** | Auto-paste targets whatever window was focused just before you pressed the hotkey. Click into your destination first. If in doubt, turn auto-paste off and use the Paste button deliberately. |
|
||||||
|
| **Transcription feels slow** | You're likely on a larger model. Switch to `tiny.en` or `base.en-q5_1` in Settings. The `small` models are inherently slow on a two-core CPU. |
|
||||||
|
| **Window vanished** | It hid to the tray. Double-click the tray icon, press `Ctrl`+`Shift`+`H`, or right-click the tray icon → Show Window. |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 13 FAQ & where things live
|
||||||
|
|
||||||
|
### Does my voice get sent anywhere?
|
||||||
|
|
||||||
|
No. All recording and transcription happen on your computer. The only time the app reaches the internet is when *you* click Download to fetch a model file.
|
||||||
|
|
||||||
|
### Can it run completely offline?
|
||||||
|
|
||||||
|
Yes — once you have at least one model installed, no internet is needed ever again.
|
||||||
|
|
||||||
|
### What languages does it support?
|
||||||
|
|
||||||
|
This build is tuned for **English** (the `.en` models). It's optimised for accuracy and speed in English on modest hardware.
|
||||||
|
|
||||||
|
### Where are my files kept?
|
||||||
|
|
||||||
|
Everything sits next to `win-dictation.exe`:
|
||||||
|
|
||||||
|
| Location | What's there |
|
||||||
|
|----------|--------------|
|
||||||
|
| `models\` | Your downloaded `.bin` speech models. |
|
||||||
|
| `history\` | One text file per dictation session. |
|
||||||
|
| `win-dictation.ini` | Your settings, hotkey, window position, learned timing, and statistics. |
|
||||||
|
| `win-dictation.log` | A simple timestamped activity log, handy if something misbehaves. |
|
||||||
|
|
||||||
|
### How do I change the hotkey?
|
||||||
|
|
||||||
|
Open `win-dictation.ini` in any text editor and edit the `hkMods` and `hkVk` values under `[app]` (they're standard Windows key codes), then restart the app. A built-in settings option for this is a natural future addition.
|
||||||
|
|
||||||
|
### Why is it called "push-to-talk" if I'm not holding a button?
|
||||||
|
|
||||||
|
It's toggle-style push-to-talk: one press starts, another stops. You're not transcribing live as you speak — you capture a clip, then it's processed. This is what keeps it fast and light on a CPU-only machine.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*Win Dictation · push-to-talk speech-to-text for Windows · powered by whisper.cpp (MIT)*
|
||||||
|
*Default hotkey Ctrl+Shift+Space · CPU-only build · runs entirely offline*
|
||||||
Reference in New Issue
Block a user