Gitea Pages: user manual and architecture docs
This commit is contained in:
@@ -0,0 +1,520 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Win Dictation — Architecture & Engineering Review</title>
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||||
|
<style>
|
||||||
|
:root{
|
||||||
|
--bg:#0E1014; --card:#16191F; --card-hi:#1E222B; --card-lo:#12151B;
|
||||||
|
--text:#ECEEF2; --dim:#8A909C; --faint:#5A606C;
|
||||||
|
--accent:#6E8BFF; --accent-hi:#839CFF; --danger:#FF5C5C; --good:#46D39A; --warn:#E8B84B;
|
||||||
|
--border:#262B36; --hair:rgba(255,255,255,.06);
|
||||||
|
--mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
|
||||||
|
--sans:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
|
||||||
|
}
|
||||||
|
*{box-sizing:border-box}
|
||||||
|
html{scroll-behavior:smooth}
|
||||||
|
body{margin:0; background:var(--bg); color:var(--text); font-family:var(--sans);
|
||||||
|
font-size:16.5px; line-height:1.72; -webkit-font-smoothing:antialiased; letter-spacing:.1px}
|
||||||
|
.wrap{max-width:960px; margin:0 auto; padding:0 6vw 140px}
|
||||||
|
a{color:var(--accent-hi); text-decoration:none} a:hover{text-decoration:underline}
|
||||||
|
|
||||||
|
.hero{padding:88px 0 34px; border-bottom:1px solid var(--border); margin-bottom:50px}
|
||||||
|
.eyebrow{font-family:var(--mono); font-size:12.5px; letter-spacing:.32em; text-transform:uppercase; color:var(--accent); margin:0 0 22px}
|
||||||
|
h1{font-size:clamp(32px,5.6vw,52px); line-height:1.05; margin:0; font-weight:800; letter-spacing:-1.2px; max-width:840px}
|
||||||
|
.sub{font-size:20px; color:var(--dim); max-width:720px; margin:20px 0 0; font-weight:400}
|
||||||
|
.metarow{display:flex; flex-wrap:wrap; gap:10px; margin-top:30px}
|
||||||
|
.chip{font-family:var(--mono); font-size:12.5px; color:var(--dim); background:var(--card); border:1px solid var(--border); border-radius:999px; padding:7px 15px}
|
||||||
|
.chip b{color:var(--text); font-weight:600}
|
||||||
|
|
||||||
|
.toc{background:linear-gradient(180deg,var(--card),var(--card-lo)); border:1px solid var(--border); border-radius:18px; padding:30px 34px; margin-bottom:60px}
|
||||||
|
.toc h4{margin:0 0 18px; font-family:var(--mono); font-size:12px; letter-spacing:.28em; text-transform:uppercase; color:var(--faint)}
|
||||||
|
.toc ol{margin:0; padding:0; list-style:none; counter-reset:t; columns:2; column-gap:46px}
|
||||||
|
.toc li{counter-increment:t; padding:7px 0; break-inside:avoid}
|
||||||
|
.toc li a{color:var(--text); font-weight:500; font-size:15.5px}
|
||||||
|
.toc li a::before{content:counter(t,decimal-leading-zero); font-family:var(--mono); color:var(--accent); font-size:12px; margin-right:13px; font-weight:600}
|
||||||
|
|
||||||
|
section{margin:0 0 72px; scroll-margin-top:30px}
|
||||||
|
.sec-h{display:flex; align-items:baseline; gap:16px; margin:0 0 10px}
|
||||||
|
.sec-n{font-family:var(--mono); font-size:14px; color:var(--accent); font-weight:600; flex:none}
|
||||||
|
h2{font-size:29px; font-weight:700; margin:0; letter-spacing:-.5px}
|
||||||
|
h3{font-size:19px; font-weight:650; margin:38px 0 12px; letter-spacing:-.2px}
|
||||||
|
.lead{color:var(--dim); font-size:18px; margin:0 0 26px; max-width:740px}
|
||||||
|
p{margin:0 0 17px} .muted{color:var(--dim)} strong{color:#fff; font-weight:650}
|
||||||
|
ul,ol{margin:0 0 18px; padding-left:22px} li{margin:9px 0}
|
||||||
|
|
||||||
|
code{font-family:var(--mono); font-size:14px; background:var(--card-hi); color:#cfe0ff; padding:2px 7px; border-radius:6px; border:1px solid var(--border)}
|
||||||
|
.path{font-family:var(--mono); font-size:13.5px; color:var(--good)}
|
||||||
|
pre{background:var(--card-lo); border:1px solid var(--border); border-radius:13px; padding:20px 22px; overflow-x:auto; margin:20px 0;
|
||||||
|
font-family:var(--mono); font-size:13.5px; line-height:1.7; color:#c8d2e0}
|
||||||
|
pre .c{color:var(--faint)} pre .k{color:#c98bff} pre .s{color:var(--good)} pre .n{color:var(--accent-hi)} pre .f{color:#ffd479}
|
||||||
|
|
||||||
|
/* verdict box */
|
||||||
|
.verdict{background:linear-gradient(135deg,rgba(110,139,255,.12),rgba(70,211,154,.06)); border:1px solid var(--border);
|
||||||
|
border-radius:18px; padding:30px 34px; margin:6px 0 10px; position:relative; overflow:hidden}
|
||||||
|
.verdict::before{content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:linear-gradient(180deg,var(--accent),var(--good))}
|
||||||
|
.verdict .vh{font-family:var(--mono); font-size:11.5px; letter-spacing:.2em; text-transform:uppercase; color:var(--accent); margin:0 0 12px}
|
||||||
|
.verdict p{font-size:18.5px; line-height:1.66; margin:0 0 14px; color:var(--text)}
|
||||||
|
.verdict p:last-child{margin:0}
|
||||||
|
.verdict .big{font-size:22px; font-weight:700; letter-spacing:-.3px}
|
||||||
|
|
||||||
|
/* pipeline */
|
||||||
|
.pipe{display:flex; flex-wrap:wrap; align-items:stretch; gap:0; margin:26px 0; border:1px solid var(--border); border-radius:14px; overflow:hidden; background:var(--card-lo)}
|
||||||
|
.stage{flex:1 1 120px; min-width:120px; padding:18px 16px; border-right:1px solid var(--border); position:relative}
|
||||||
|
.stage:last-child{border-right:0}
|
||||||
|
.stage .si{font-family:var(--mono); font-size:11px; color:var(--faint); margin:0 0 8px}
|
||||||
|
.stage .sn{font-weight:650; font-size:14.5px; margin:0 0 4px; color:var(--text)}
|
||||||
|
.stage .sd{font-size:12.5px; color:var(--dim); line-height:1.5; margin:0}
|
||||||
|
.stage.hot{background:linear-gradient(180deg,rgba(110,139,255,.1),transparent)}
|
||||||
|
.stage.work{background:linear-gradient(180deg,rgba(70,211,154,.1),transparent)}
|
||||||
|
|
||||||
|
.tbl{width:100%; border-collapse:collapse; margin:20px 0; font-size:14.5px; border-radius:12px; overflow:hidden; border:1px solid var(--border)}
|
||||||
|
.tbl th{text-align:left; font-family:var(--mono); font-size:11px; letter-spacing:.1em; text-transform:uppercase; color:var(--dim); padding:12px 15px; background:var(--card-lo); border-bottom:1px solid var(--border); font-weight:600}
|
||||||
|
.tbl td{padding:12px 15px; border-bottom:1px solid var(--border); vertical-align:top}
|
||||||
|
.tbl tr:last-child td{border-bottom:0}
|
||||||
|
.tbl td code{font-size:13px}
|
||||||
|
.tbl .r{color:var(--dim); font-size:13.5px}
|
||||||
|
|
||||||
|
.note{border:1px solid var(--border); border-left:3px solid var(--accent); background:linear-gradient(90deg,rgba(110,139,255,.08),transparent 60%); border-radius:12px; padding:17px 20px; margin:22px 0}
|
||||||
|
.note.warn{border-left-color:var(--warn); background:linear-gradient(90deg,rgba(232,184,75,.09),transparent 60%)}
|
||||||
|
.note.bad{border-left-color:var(--danger); background:linear-gradient(90deg,rgba(255,92,92,.08),transparent 60%)}
|
||||||
|
.note.good{border-left-color:var(--good); background:linear-gradient(90deg,rgba(70,211,154,.08),transparent 60%)}
|
||||||
|
.note .nt{font-family:var(--mono); font-size:11.5px; letter-spacing:.18em; text-transform:uppercase; color:var(--dim); margin:0 0 6px}
|
||||||
|
.note p:last-child{margin:0}
|
||||||
|
|
||||||
|
/* assessment cards */
|
||||||
|
.assess{display:grid; gap:14px; margin:22px 0}
|
||||||
|
.ac{border:1px solid var(--border); border-radius:13px; padding:18px 20px; background:var(--card)}
|
||||||
|
.ac .ah{display:flex; align-items:center; gap:11px; margin:0 0 7px}
|
||||||
|
.ac .dot{width:9px;height:9px;border-radius:50%; flex:none}
|
||||||
|
.ac.pos .dot{background:var(--good)} .ac.neg .dot{background:var(--danger)} .ac.neu .dot{background:var(--warn)}
|
||||||
|
.ac h4{margin:0; font-size:16.5px; font-weight:650}
|
||||||
|
.ac p{margin:0; color:var(--dim); font-size:14.5px; line-height:1.62}
|
||||||
|
.ac .ref{font-family:var(--mono); font-size:12px; color:var(--faint); margin-top:7px}
|
||||||
|
|
||||||
|
/* scorecard */
|
||||||
|
.score{background:var(--card); border:1px solid var(--border); border-radius:16px; padding:28px 30px; margin:24px 0}
|
||||||
|
.srow{display:grid; grid-template-columns:200px 1fr 50px; align-items:center; gap:18px; padding:11px 0; border-bottom:1px solid var(--border)}
|
||||||
|
.srow:last-child{border-bottom:0}
|
||||||
|
.srow .sl{font-size:14.5px; font-weight:500}
|
||||||
|
.srow .sb{height:9px; background:var(--card-hi); border-radius:99px; overflow:hidden}
|
||||||
|
.srow .sf{height:100%; border-radius:99px; background:linear-gradient(90deg,var(--accent),var(--accent-hi))}
|
||||||
|
.srow .sf.hi{background:linear-gradient(90deg,#46D39A,#6ee0b0)}
|
||||||
|
.srow .sf.lo{background:linear-gradient(90deg,#E8B84B,#f0cd77)}
|
||||||
|
.srow .sf.vlo{background:linear-gradient(90deg,#FF5C5C,#ff8585)}
|
||||||
|
.srow .sv{font-family:var(--mono); font-size:14px; font-weight:600; text-align:right; color:var(--text)}
|
||||||
|
.overall{display:flex; align-items:baseline; gap:16px; margin-top:22px; padding-top:22px; border-top:1px solid var(--border)}
|
||||||
|
.overall .num{font-size:46px; font-weight:800; letter-spacing:-2px; color:var(--accent-hi); font-family:var(--mono)}
|
||||||
|
.overall .ot{color:var(--dim); font-size:15px}
|
||||||
|
|
||||||
|
/* recommendations */
|
||||||
|
.rec{counter-reset:r; margin:22px 0; padding:0; list-style:none}
|
||||||
|
.rec li{counter-increment:r; position:relative; padding:16px 18px 16px 60px; margin:0 0 12px; background:var(--card); border:1px solid var(--border); border-radius:12px}
|
||||||
|
.rec li::before{content:counter(r); position:absolute; left:16px; top:16px; width:30px;height:30px;border-radius:9px; background:var(--card-hi); color:var(--accent); font-family:var(--mono); font-weight:700; display:flex; align-items:center; justify-content:center; font-size:14px}
|
||||||
|
.rec h4{margin:0 0 4px; font-size:16px; font-weight:650}
|
||||||
|
.rec p{margin:0; color:var(--dim); font-size:14.5px}
|
||||||
|
.pri{font-family:var(--mono); font-size:10.5px; letter-spacing:.1em; text-transform:uppercase; padding:2px 8px; border-radius:5px; margin-left:9px; vertical-align:middle}
|
||||||
|
.pri.hi{background:rgba(255,92,92,.16); color:var(--danger)}
|
||||||
|
.pri.md{background:rgba(232,184,75,.16); color:var(--warn)}
|
||||||
|
.pri.lo{background:rgba(138,144,156,.16); color:var(--dim)}
|
||||||
|
|
||||||
|
.stackgrid{display:grid; grid-template-columns:repeat(2,1fr); gap:14px; margin:22px 0}
|
||||||
|
.scell{background:var(--card); border:1px solid var(--border); border-radius:12px; padding:16px 18px}
|
||||||
|
.scell .sk{font-family:var(--mono); font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--faint); margin:0 0 6px}
|
||||||
|
.scell .sv{font-size:15px; color:var(--text); font-weight:500}
|
||||||
|
.scell .sv span{color:var(--dim); font-weight:400; font-size:13.5px}
|
||||||
|
|
||||||
|
.footer{border-top:1px solid var(--border); margin-top:80px; padding-top:30px; color:var(--faint); font-size:13.5px; font-family:var(--mono)}
|
||||||
|
.footer b{color:var(--dim); font-weight:500}
|
||||||
|
|
||||||
|
@media(max-width:680px){
|
||||||
|
.toc ol,.stackgrid{columns:1; grid-template-columns:1fr}
|
||||||
|
.srow{grid-template-columns:1fr; gap:6px}
|
||||||
|
.srow .sv{text-align:left}
|
||||||
|
.pipe .stage{flex-basis:100%; border-right:0; border-bottom:1px solid var(--border)}
|
||||||
|
body{font-size:16px}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style>
|
||||||
|
.ha-img-placeholder{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;background:#f4f4f5;border:1px dashed #d4d4d8;border-radius:8px;color:#71717a;font-size:12px;font-family:system-ui,sans-serif;min-height:80px;padding:16px;box-sizing:border-box;animation:ha-img-pulse 1.5s ease-in-out infinite}
|
||||||
|
.ha-img-placeholder.ha-failed{animation:none;opacity:.7}
|
||||||
|
@keyframes ha-img-pulse{0%,100%{opacity:1}50%{opacity:.5}}
|
||||||
|
@media(prefers-color-scheme:dark){.ha-img-placeholder{background:#27272a;border-color:#3f3f46;color:#a1a1aa}}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="wrap">
|
||||||
|
|
||||||
|
<header class="hero">
|
||||||
|
<p class="eyebrow">Architecture · Code Analysis · Engineering Verdict</p>
|
||||||
|
<h1>Win Dictation: under the hood</h1>
|
||||||
|
<p class="sub">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.</p>
|
||||||
|
<div class="metarow">
|
||||||
|
<span class="chip"><b>~3,400</b> lines C++ (app)</span>
|
||||||
|
<span class="chip"><b>Win32</b> + GDI+ + SDL2 + whisper.cpp</span>
|
||||||
|
<span class="chip"><b>Single .exe</b>, no runtime deps</span>
|
||||||
|
<span class="chip"><b>Target</b> 2-core i5, CPU-only</span>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<nav class="toc">
|
||||||
|
<h4>Contents</h4>
|
||||||
|
<ol>
|
||||||
|
<li><a href="#tldr">The verdict, up front</a></li>
|
||||||
|
<li><a href="#stack">Stack at a glance</a></li>
|
||||||
|
<li><a href="#arch">Architecture & data flow</a></li>
|
||||||
|
<li><a href="#decision">The defining decision</a></li>
|
||||||
|
<li><a href="#threads">Threading model</a></li>
|
||||||
|
<li><a href="#map">Source map, file by file</a></li>
|
||||||
|
<li><a href="#ui">Deep dive: the UI engine</a></li>
|
||||||
|
<li><a href="#timing">Deep dive: the progress estimator</a></li>
|
||||||
|
<li><a href="#transcriber">Deep dive: the transcriber</a></li>
|
||||||
|
<li><a href="#persistence">History, downloads & persistence</a></li>
|
||||||
|
<li><a href="#anatomy">Anatomy of one dictation</a></li>
|
||||||
|
<li><a href="#strengths">What's done well</a></li>
|
||||||
|
<li><a href="#weaknesses">What holds it back</a></li>
|
||||||
|
<li><a href="#recs">Recommendations</a></li>
|
||||||
|
<li><a href="#scorecard">Scorecard & final word</a></li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<!-- 1 -->
|
||||||
|
<section id="tldr">
|
||||||
|
<div class="sec-h"><span class="sec-n">01</span><h2>The verdict, up front</h2></div>
|
||||||
|
<div class="verdict">
|
||||||
|
<p class="vh">Bottom line</p>
|
||||||
|
<p class="big">A genuinely strong, characterful single-purpose tool that punches well above hobby grade.</p>
|
||||||
|
<p>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.</p>
|
||||||
|
<p>What holds it back is <strong>organizational debt, not algorithmic weakness</strong>: a 1,500-line <code>main.cpp</code>, 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.</p>
|
||||||
|
</div>
|
||||||
|
<p class="muted">The sections below back up every part of that judgement with specifics from the source.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 2 -->
|
||||||
|
<section id="stack">
|
||||||
|
<div class="sec-h"><span class="sec-n">02</span><h2>Stack at a glance</h2></div>
|
||||||
|
<p class="lead">Deliberately lean. No UI framework, no managed runtime, no garbage collector — just the OS and three libraries.</p>
|
||||||
|
<div class="stackgrid">
|
||||||
|
<div class="scell"><p class="sk">Language</p><p class="sv">C++ <span>(MSVC, Release /O2 /GL /LTCG, AVX2/FMA/F16C)</span></p></div>
|
||||||
|
<div class="scell"><p class="sk">UI</p><p class="sv">Raw Win32 + GDI+ <span>immediate-mode painted surface</span></p></div>
|
||||||
|
<div class="scell"><p class="sk">Audio capture</p><p class="sv">SDL2 <span>16 kHz mono, F32</span></p></div>
|
||||||
|
<div class="scell"><p class="sk">Inference</p><p class="sv">whisper.cpp <span>whisper_full, CPU backend</span></p></div>
|
||||||
|
<div class="scell"><p class="sk">Networking</p><p class="sv">WinHTTP <span>model downloads, system proxy aware</span></p></div>
|
||||||
|
<div class="scell"><p class="sk">Persistence</p><p class="sv">Plain INI + UTF-8 text files <span>no database</span></p></div>
|
||||||
|
<div class="scell"><p class="sk">Build</p><p class="sv">CMake <span>+ a PowerShell convenience script</span></p></div>
|
||||||
|
<div class="scell"><p class="sk">Footprint</p><p class="sv">One .exe + a few DLLs + model <span>tiny RAM, no install</span></p></div>
|
||||||
|
</div>
|
||||||
|
<p>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).</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 3 -->
|
||||||
|
<section id="arch">
|
||||||
|
<div class="sec-h"><span class="sec-n">03</span><h2>Architecture & data flow</h2></div>
|
||||||
|
<p class="lead">A linear pipeline with a single inference step. Audio in, text out, no streaming loop.</p>
|
||||||
|
<div class="pipe">
|
||||||
|
<div class="stage hot"><p class="si">trigger</p><p class="sn">Hotkey</p><p class="sd">Global <code>RegisterHotKey</code>. Captures the previously focused window.</p></div>
|
||||||
|
<div class="stage"><p class="si">capture</p><p class="sn">SDL2 mic</p><p class="sd">16 kHz mono into an in-memory buffer. Near-zero CPU.</p></div>
|
||||||
|
<div class="stage"><p class="si">buffer</p><p class="sn">PCM in RAM</p><p class="sd">Accumulated under a mutex; RMS energy tracked for the meter.</p></div>
|
||||||
|
<div class="stage work"><p class="si">inference</p><p class="sn">whisper_full</p><p class="sd">One pass on a worker thread when you stop. Trim → transcribe → clean.</p></div>
|
||||||
|
<div class="stage"><p class="si">deliver</p><p class="sn">Insert + paste</p><p class="sd">Text to caret, to clipboard, into the prior window.</p></div>
|
||||||
|
</div>
|
||||||
|
<p>Two side channels run alongside the main pipeline: a <strong>progress estimator</strong> that predicts and smooths the transcription countdown, and a <strong>timing model</strong> that learns this machine's speed and feeds back into the next prediction. Results return to the UI thread exclusively via <code>PostMessage</code>; shared flags are <code>std::atomic</code>.</p>
|
||||||
|
<div class="note">
|
||||||
|
<p class="nt">Mental model</p>
|
||||||
|
<p>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.</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 4 -->
|
||||||
|
<section id="decision">
|
||||||
|
<div class="sec-h"><span class="sec-n">04</span><h2>The defining decision</h2></div>
|
||||||
|
<p class="lead">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.</p>
|
||||||
|
<p>An earlier version used the classic whisper.cpp streaming approach: a rolling 5–6 second window re-transcribed every ~0.4 seconds. That technique <em>assumes</em> 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.</p>
|
||||||
|
<p>The fix wasn't a faster model. It was removing the streaming loop entirely:</p>
|
||||||
|
<table class="tbl">
|
||||||
|
<tr><th>Aspect</th><th>Old: streaming window</th><th>New: push-to-talk batch</th></tr>
|
||||||
|
<tr><td>CPU while speaking</td><td class="r">Pinned — constant re-inference</td><td>Near idle — just buffering</td></tr>
|
||||||
|
<tr><td>Inference calls</td><td class="r">Many per second</td><td>Exactly one, on stop</td></tr>
|
||||||
|
<tr><td>Accuracy</td><td class="r">Lower — partial context windows</td><td>Higher — full clip, full context</td></tr>
|
||||||
|
<tr><td>UI responsiveness</td><td class="r">Starved under load</td><td>Free until the single pass</td></tr>
|
||||||
|
<tr><td>Predictability</td><td class="r">Variable lag</td><td>Predictable few-second wait</td></tr>
|
||||||
|
</table>
|
||||||
|
<p>This is textbook root-cause engineering: the team correctly diagnosed that the bottleneck was the <em>shape</em> 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.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 5 -->
|
||||||
|
<section id="threads">
|
||||||
|
<div class="sec-h"><span class="sec-n">05</span><h2>Threading model</h2></div>
|
||||||
|
<p class="lead">Four threads, one rule: only the UI thread touches the UI. Everything else reports back by message.</p>
|
||||||
|
<table class="tbl">
|
||||||
|
<tr><th>Thread</th><th>Lifetime</th><th>Job</th></tr>
|
||||||
|
<tr><td><b>UI thread</b></td><td class="r">Whole app</td><td>Message loop, all painting, the 16 ms animation timer and 50 ms update timer.</td></tr>
|
||||||
|
<tr><td><b>Model preload</b></td><td class="r">Detached, once</td><td>Loads the Whisper context off the UI thread at startup so the window appears instantly.</td></tr>
|
||||||
|
<tr><td><b>Transcribe worker</b></td><td class="r">Per clip</td><td>Runs <code>whisper_full</code>; posts <code>WM_APP_PROGRESS</code> during and <code>WM_APP_RESULT</code> when done.</td></tr>
|
||||||
|
<tr><td><b>Downloader</b></td><td class="r">Per download</td><td>WinHTTP fetch on its own thread; posts <code>WM_APP_DLPROGRESS</code>.</td></tr>
|
||||||
|
</table>
|
||||||
|
<p>Cross-thread state is handled with discipline rather than locks where possible: <code>std::atomic</code> booleans (<code>m_recording</code>, <code>m_busy</code>, <code>m_abort</code>, <code>g_modelLoaded</code>, <code>g_modelOk</code>) 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; <code>stop_and_transcribe</code> swaps the buffer out under the same lock before handing it to the worker. That swap-not-copy handoff is a nice touch.</p>
|
||||||
|
<pre><span class="c">// transcriber.cpp — physical cores, not logical, by design</span>
|
||||||
|
<span class="k">int</span> Transcriber::<span class="f">default_threads</span>() {
|
||||||
|
<span class="k">unsigned</span> hc = std::thread::<span class="f">hardware_concurrency</span>();
|
||||||
|
<span class="k">if</span> (hc <= 2) <span class="k">return</span> (<span class="k">int</span>)std::<span class="f">max</span>(1u, hc);
|
||||||
|
<span class="k">return</span> (<span class="k">int</span>)(hc / 2); <span class="c">// 4 logical → 2 worker threads</span>
|
||||||
|
}</pre>
|
||||||
|
<p>Defaulting to physical cores rather than <code>hardware_concurrency()</code> is the correct choice for compute-bound SIMD inference — hyperthreads contend for the same execution units and would only add scheduling overhead.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 6 -->
|
||||||
|
<section id="map">
|
||||||
|
<div class="sec-h"><span class="sec-n">06</span><h2>Source map, file by file</h2></div>
|
||||||
|
<p class="lead">The app is small and mostly header-only outside the two big translation units. Here's where everything lives.</p>
|
||||||
|
<table class="tbl">
|
||||||
|
<tr><th>File</th><th>Role</th><th>Notes</th></tr>
|
||||||
|
<tr><td><code>main.cpp</code></td><td>Window, painting, interaction, settings view, clipboard, paste, model selection, popups</td><td class="r">~1,500 lines. The monolith — see §13.</td></tr>
|
||||||
|
<tr><td><code>transcriber.{h,cpp}</code></td><td>SDL capture, Whisper preload/inference, progress & abort callbacks</td><td class="r">Clean, well-scoped class. The model layer.</td></tr>
|
||||||
|
<tr><td><code>timing.h</code></td><td>Per-model least-squares timing model + live progress estimator + INI persistence</td><td class="r">The standout module. See §08.</td></tr>
|
||||||
|
<tr><td><code>history.h</code></td><td>Session text files, UTF-8 r/w with BOM, index, pruning to 100</td><td class="r">Self-contained, header-only.</td></tr>
|
||||||
|
<tr><td><code>downloader.h</code></td><td>WinHTTP model downloader on a background thread</td><td class="r">.part + atomic rename, cancel, proxy-aware.</td></tr>
|
||||||
|
<tr><td><code>stats.h</code></td><td>Lifetime usage totals + derived figures (wpm, real-time factor, time saved)</td><td class="r">INI-backed, header-only.</td></tr>
|
||||||
|
<tr><td><code>settings.h</code></td><td>App settings read/write via <code>GetPrivateProfile*</code></td><td class="r">Simple and transparent.</td></tr>
|
||||||
|
<tr><td><code>text_util.h</code> · <code>logging.h</code></td><td>Transcript concatenation; timestamped file log</td><td class="r">Tiny helpers.</td></tr>
|
||||||
|
<tr><td><code>tests/test_core.cpp</code></td><td>Unit checks: append logic, bad-model handling, real-WAV transcription, progress monotonicity</td><td class="r">Modest but meaningful. Built as <code>test-core</code>.</td></tr>
|
||||||
|
</table>
|
||||||
|
<p>The decision to make most subsystems <strong>header-only and independent</strong> (<code>timing.h</code>, <code>stats.h</code>, <code>history.h</code>, <code>downloader.h</code>, <code>settings.h</code>) is a good one for a project this size: each is cohesive, individually readable, and free of cross-dependencies. The contrast with <code>main.cpp</code> — which absorbs everything else — is stark.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 7 -->
|
||||||
|
<section id="ui">
|
||||||
|
<div class="sec-h"><span class="sec-n">07</span><h2>Deep dive: the single-surface UI engine</h2></div>
|
||||||
|
<p class="lead">There are no buttons. Everything you see is painted onto one double-buffered surface — and that's a deliberate fix, not a shortcut.</p>
|
||||||
|
<p>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 <code>WS_CLIPCHILDREN</code> punches per child, plus the edit's themed border. Rather than chase pixel borders, the rebuild eliminated the cause: <strong>collapse the controls into one painted region.</strong></p>
|
||||||
|
<p>The model is a small immediate-mode system:</p>
|
||||||
|
<ul>
|
||||||
|
<li>A flat <code>Widget g_w[]</code> array — each entry is a <em>kind</em>, a rectangle, and <code>hover/pressed/anim</code> state. No HWNDs.</li>
|
||||||
|
<li><code>LayoutWidgets()</code> positions them; <code>PaintSurface()</code> draws each into an off-screen DC with GDI+, then blits once (no flicker).</li>
|
||||||
|
<li><code>HitTest()</code> maps a click point to a widget; <code>OnClick()</code> dispatches the action.</li>
|
||||||
|
<li>An animation clock eases each widget's <code>anim</code> toward a target (hover 0.6, active 1.0) on a 16 ms timer that <em>stops itself</em> when nothing is moving — no idle CPU burn.</li>
|
||||||
|
</ul>
|
||||||
|
<p>Two "views" — Main and Settings — render onto the same surface, toggled by <code>SwitchView()</code>. Dropdowns (mic, history) are the one exception: they're real top-level <code>WS_POPUP</code> windows, because a surface-painted dropdown would render <em>behind</em> the transcript edit (a child HWND always paints above its parent's surface). That's a correct, well-reasoned exception.</p>
|
||||||
|
<div class="note good">
|
||||||
|
<p class="nt">A sign of maturity</p>
|
||||||
|
<p>The popup code carries a comment never to open a <code>MessageBox</code> from inside it — because <code>WA_INACTIVE</code> self-destroys the popup mid-handler, causing a use-after-free. Recognising that class of Win32 lifetime bug, and the GDI+ "<code>GetHDC</code> locks the Graphics object" trap documented elsewhere, shows real depth.</p>
|
||||||
|
</div>
|
||||||
|
<p>The one real child window that survives is the transcript <code>EDIT</code> — kept because a hand-rolled text editor with selection, scrolling, IME and undo is genuinely not worth rebuilding. Pragmatic.</p>
|
||||||
|
<h3>The cost of this approach</h3>
|
||||||
|
<p>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.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 8 -->
|
||||||
|
<section id="timing">
|
||||||
|
<div class="sec-h"><span class="sec-n">08</span><h2>Deep dive: the progress estimator</h2></div>
|
||||||
|
<p class="lead">The crown jewel. Most apps fake a progress bar; this one runs a small statistical model that learns your machine.</p>
|
||||||
|
<p>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 <em>up</em>. <code>timing.h</code> solves both. It has two parts.</p>
|
||||||
|
<h3>1 — A learned timing model</h3>
|
||||||
|
<p>Processing time is modelled as a linear function of audio length, <code>proc = a + b·audio</code>, fitted by <strong>decayed online least-squares</strong>. 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.</p>
|
||||||
|
<pre><span class="k">void</span> <span class="f">add_sample</span>(<span class="k">double</span> audio_sec, <span class="k">double</span> proc_sec) {
|
||||||
|
<span class="k">const double</span> decay = <span class="n">0.97</span>;
|
||||||
|
n*=decay; sx*=decay; sy*=decay; sxx*=decay; sxy*=decay;
|
||||||
|
n+=<span class="n">1</span>; sx+=audio_sec; sy+=proc_sec;
|
||||||
|
sxx+=audio_sec*audio_sec; sxy+=audio_sec*proc_sec;
|
||||||
|
<span class="f">recompute</span>(); <span class="c">// closed-form slope/intercept</span>
|
||||||
|
}</pre>
|
||||||
|
<h3>2 — A live estimator that only counts down</h3>
|
||||||
|
<p>On stop, <code>begin(predict)</code> seeds a predicted total. As Whisper reports chunk progress, <code>on_whisper()</code> folds it in as a <em>measurement</em> via an EMA (α = 0.5) — nudging the estimate without the jumpy jumps. Meanwhile <code>tick()</code> advances a displayed "remaining" value that is <strong>strictly monotonic downward</strong>, 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.</p>
|
||||||
|
<pre><span class="k">void</span> <span class="f">tick</span>(<span class="k">double</span> dt, <span class="k">float</span>& out_frac, <span class="k">float</span>& out_remaining) {
|
||||||
|
t += dt; disp_rem -= dt;
|
||||||
|
<span class="k">double</span> raw_rem = std::<span class="f">max</span>(<span class="n">0.0</span>, T_hat - t);
|
||||||
|
<span class="k">double</span> err = raw_rem - disp_rem;
|
||||||
|
<span class="k">if</span> (err < <span class="n">0</span>) disp_rem += std::<span class="f">max</span>(err, -maxCatchUp*dt); <span class="c">// catch up, never jump back</span>
|
||||||
|
<span class="k">double</span> frac = t/(t+disp_rem);
|
||||||
|
<span class="k">if</span> (frac > <span class="n">0.95</span>) frac = <span class="n">0.95</span>; <span class="c">// park at 95% until done</span>
|
||||||
|
out_frac = (<span class="k">float</span>)frac; out_remaining = (<span class="k">float</span>)disp_rem;
|
||||||
|
}</pre>
|
||||||
|
<p>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 <em>feel</em> of the product, not just its function.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 9 -->
|
||||||
|
<section id="transcriber">
|
||||||
|
<div class="sec-h"><span class="sec-n">09</span><h2>Deep dive: the transcriber</h2></div>
|
||||||
|
<p class="lead">The cleanest class in the project — a tidy boundary between the OS/model and the rest of the app.</p>
|
||||||
|
<p><code>Transcriber</code> owns the Whisper context and the SDL device, and exposes a small, sensible surface: <code>preload</code>, <code>reload</code>, <code>start_recording</code>, <code>stop_and_transcribe</code>, <code>cancel</code>, plus state queries and two callbacks (<code>result</code>, <code>progress</code>). Inference parameters are configured sensibly for dictation — greedy sampling, no timestamps, no prior context, blank/non-speech suppression, temperature 0 — and an <code>abort_callback</code> lets a long transcription be cancelled mid-flight.</p>
|
||||||
|
<p>Two small details worth calling out:</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Silence trimming.</strong> Before inference, leading/trailing silence is trimmed from the clip — cheaper and more accurate than transcribing dead air. (Note: this trims the <em>buffer</em>; it does not auto-stop recording — see the doc-drift note in §13.)</li>
|
||||||
|
<li><strong>Output cleanup.</strong> <code>clean_text()</code> strips Whisper's <code>[BLANK_AUDIO]</code> / <code>[NOISE]</code> artifacts and trims whitespace, so the user never sees model noise.</li>
|
||||||
|
</ul>
|
||||||
|
<p>The class is also defensively coded: a missing model file makes <code>preload</code> return false cleanly (the test suite verifies this), <code>start_recording</code> bails if a device won't open, and clips under ~0.3 s short-circuit to an empty result rather than invoking the model.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 10 -->
|
||||||
|
<section id="persistence">
|
||||||
|
<div class="sec-h"><span class="sec-n">10</span><h2>History, downloads & persistence</h2></div>
|
||||||
|
<p class="lead">No database, no registry sprawl — everything is a file next to the executable. Transparent and portable.</p>
|
||||||
|
<h3>Session history</h3>
|
||||||
|
<p>Each session is one UTF-8 text file in <span class="path">history\</span>, named by timestamp. The clever bit is <em>live</em> archiving: the first clip of a session creates the file; subsequent clips rewrite the <em>same</em> 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 <code>g_sessionPath</code> global plus a <code>FinalizeSession()</code> 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.</p>
|
||||||
|
<div class="note">
|
||||||
|
<p class="nt">A real bug was fixed here</p>
|
||||||
|
<p>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.</p>
|
||||||
|
</div>
|
||||||
|
<h3>Model downloads</h3>
|
||||||
|
<p>The downloader is more robust than it needed to be, in a good way: it streams to a <code>.part</code> 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 <code>.part</code> files at startup.</p>
|
||||||
|
<h3>Settings, timing & stats</h3>
|
||||||
|
<p>All three live in a single <span class="path">win-dictation.ini</span> under different sections — app settings, per-model timing accumulators, and lifetime stats. Using the OS's own <code>GetPrivateProfile*</code> 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.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 11 -->
|
||||||
|
<section id="anatomy">
|
||||||
|
<div class="sec-h"><span class="sec-n">11</span><h2>Anatomy of one dictation</h2></div>
|
||||||
|
<p class="lead">Following a single clip end-to-end ties the whole system together.</p>
|
||||||
|
<ol>
|
||||||
|
<li><code>WM_HOTKEY</code> fires → the app records <code>g_prevForeground</code> and the current selection (<code>EM_GETSEL</code>) so it knows where to paste and where to insert.</li>
|
||||||
|
<li><code>g_tx.start_recording()</code> opens the SDL device; the audio callback appends PCM under the capture mutex and updates the RMS energy meter.</li>
|
||||||
|
<li>The 50 ms UI timer animates the level meter and ticks the on-screen recording clock.</li>
|
||||||
|
<li>Second <code>WM_HOTKEY</code> → <code>g_est.begin(g_timing.predict(len))</code> seeds the progress estimate; <code>g_tx.stop_and_transcribe()</code> swaps the buffer to a worker thread.</li>
|
||||||
|
<li>The worker runs <code>run_inference()</code> → <code>whisper_full</code>. Whisper's progress callback posts <code>WM_APP_PROGRESS</code>; the estimator's <code>on_whisper()</code> EMA-folds it in.</li>
|
||||||
|
<li>On completion the worker posts <code>WM_APP_RESULT</code>.</li>
|
||||||
|
<li>The UI thread then, in order: snaps progress to 100%, records a real timing sample (<code>add_sample</code> + <code>SaveTiming</code>), updates lifetime stats, inserts the text at the saved caret with smart spacing via <code>EM_REPLACESEL</code> (undoable), archives the session, copies to the clipboard, and pastes into <code>g_prevForeground</code>.</li>
|
||||||
|
</ol>
|
||||||
|
<p>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.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 12 -->
|
||||||
|
<section id="strengths">
|
||||||
|
<div class="sec-h"><span class="sec-n">12</span><h2>What's done well</h2></div>
|
||||||
|
<div class="assess">
|
||||||
|
<div class="ac pos"><div class="ah"><span class="dot"></span><h4>The architecture fits the hardware</h4></div><p>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.</p></div>
|
||||||
|
<div class="ac pos"><div class="ah"><span class="dot"></span><h4>The progress estimator is exceptional</h4></div><p>Decayed online least-squares + EMA fusion + a strictly monotonic countdown is far beyond what the task demanded — and it shows in the feel.</p></div>
|
||||||
|
<div class="ac pos"><div class="ah"><span class="dot"></span><h4>Seam-free UI by elimination, not patching</h4></div><p>Collapsing nine child windows into one painted, double-buffered, DPI-aware, self-throttling surface removed the problem at its source.</p></div>
|
||||||
|
<div class="ac pos"><div class="ah"><span class="dot"></span><h4>Clean module boundaries (outside main)</h4></div><p>Header-only, dependency-free subsystems (timing, history, downloader, stats, settings) are each individually readable and testable.</p></div>
|
||||||
|
<div class="ac pos"><div class="ah"><span class="dot"></span><h4>Robustness in the right places</h4></div><p>Atomic rename downloads, crash-safe live history, graceful missing-model handling, cancellable inference, single-instance mutex, model preload off the UI thread.</p></div>
|
||||||
|
<div class="ac pos"><div class="ah"><span class="dot"></span><h4>Real product thoughtfulness</h4></div><p>Smart insertion spacing, undoable edits, auto-paste into the prior window, auto-hide, learned timing, friendly stats. These are details a careful builder adds.</p></div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 13 -->
|
||||||
|
<section id="weaknesses">
|
||||||
|
<div class="sec-h"><span class="sec-n">13</span><h2>What holds it back</h2></div>
|
||||||
|
<p class="lead">All fixable, and none of it affects the running app. But it's exactly what a newcomer trips over.</p>
|
||||||
|
<div class="assess">
|
||||||
|
<div class="ac neu"><div class="ah"><span class="dot"></span><h4><code>main.cpp</code> is a 1,500-line god object</h4></div><p>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.</p></div>
|
||||||
|
<div class="ac neu"><div class="ah"><span class="dot"></span><h4>Vestigial child windows & duplicate code paths</h4></div><p>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 <code>WM_COMMAND</code> handlers duplicate the painted-widget <code>OnClick</code> logic — e.g. the Copy action exists in two near-identical places. Leftovers from the rebuild that should be deleted.</p><p class="ref">main.cpp — CreateWindow(...) blocks then ShowWindow(..., SW_HIDE)</p></div>
|
||||||
|
<div class="ac neg"><div class="ah"><span class="dot"></span><h4>Documentation describes a different app</h4></div><p>This is the most actively misleading issue. <code>CUDA-SETUP.md</code>, <code>QUICK-REBUILD-GPU.md</code> and <code>FIXES-APPLIED.md</code> describe a streaming, VAD, ring-buffer, 24-thread, RTX 3090 design that no longer exists. <code>build.ps1</code> still hunts for CUDA and downloads <code>base.en</code> though the product is a CPU-only <code>tiny.en</code> app. <code>TESTING.md</code> references a <code>test-audio.exe</code> the CMake doesn't build (it builds <code>test-core</code>). A newcomer reading the docs would form a completely wrong mental model.</p></div>
|
||||||
|
<div class="ac neg"><div class="ah"><span class="dot"></span><h4>The README claims a feature that isn't there</h4></div><p>Both <code>README.md</code> and <code>CHANGES.md</code> 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 <em>trimmed</em> before inference, which is likely the source of the confusion.) Either implement it or remove the claim.</p><p class="ref">main.cpp WM_TIMER recording branch vs README "Audio Processing"</p></div>
|
||||||
|
<div class="ac neu"><div class="ah"><span class="dot"></span><h4>Heavy reliance on global mutable state</h4></div><p>The UI is coordinated through dozens of file-scope globals (<code>g_*</code>), 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.</p></div>
|
||||||
|
<div class="ac neu"><div class="ah"><span class="dot"></span><h4>Build declares C++11 but uses C++17</h4></div><p><code>CMakeLists.txt</code> sets <code>CMAKE_CXX_STANDARD 11</code>, yet the code uses <code>std::size()</code> (C++17). It compiles only because MSVC's default is newer. Set the standard to 17 explicitly so the build is honest and portable.</p></div>
|
||||||
|
<div class="ac neu"><div class="ah"><span class="dot"></span><h4>Minor: redundant color systems & no in-app hotkey editor</h4></div><p>Three overlapping palettes coexist (<code>CR_*</code> COLORREF, <code>T_*</code> GDI+ Color, <code>C_*</code> aliases). And changing the hotkey requires hand-editing the INI — a natural gap given the polished Settings screen already exists.</p></div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 14 -->
|
||||||
|
<section id="recs">
|
||||||
|
<div class="sec-h"><span class="sec-n">14</span><h2>Recommendations</h2></div>
|
||||||
|
<p class="lead">If the next session had a short to-do list, this would be it — ordered by payoff for effort.</p>
|
||||||
|
<ol class="rec">
|
||||||
|
<li><h4>Purge or archive the stale docs <span class="pri hi">high</span></h4><p>Delete or clearly mark <code>CUDA-SETUP.md</code>, <code>QUICK-REBUILD-GPU.md</code>, <code>FIXES-APPLIED.md</code>, <code>TESTING.md</code> and <code>DESIGN.md</code> as describing the retired streaming design. This is the single biggest improvement to onboarding, and it's nearly free.</p></li>
|
||||||
|
<li><h4>Reconcile the README with reality <span class="pri hi">high</span></h4><p>Remove the "500 ms silence auto-end" claim (or implement it). Update the model table and build commands to match the CPU-only product.</p></li>
|
||||||
|
<li><h4>Delete the vestigial child windows <span class="pri md">medium</span></h4><p>Remove the hidden owner-draw controls and their dead <code>WM_COMMAND</code> handlers so there's exactly one code path per action. De-duplicate Copy.</p></li>
|
||||||
|
<li><h4>Break up <code>main.cpp</code> <span class="pri md">medium</span></h4><p>Lift the Settings view, the popup window, and the GDI+ drawing helpers into their own files. Even a mechanical split dramatically improves navigability.</p></li>
|
||||||
|
<li><h4>Fix the build standard & align <code>build.ps1</code> <span class="pri md">medium</span></h4><p>Set <code>CMAKE_CXX_STANDARD 17</code>. Strip the CUDA detection from the build script and default it to fetching <code>tiny.en</code>.</p></li>
|
||||||
|
<li><h4>Add an in-app hotkey picker <span class="pri lo">low</span></h4><p>The Settings surface already exists; surfacing the hotkey there closes an obvious UX gap and removes a troubleshooting step.</p></li>
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 15 -->
|
||||||
|
<section id="scorecard">
|
||||||
|
<div class="sec-h"><span class="sec-n">15</span><h2>Scorecard & final word</h2></div>
|
||||||
|
<div class="score">
|
||||||
|
<div class="srow"><span class="sl">Architecture & design</span><span class="sb"><span class="sf hi" style="width:92%"></span></span><span class="sv">9.2</span></div>
|
||||||
|
<div class="srow"><span class="sl">Performance fit for target</span><span class="sb"><span class="sf hi" style="width:93%"></span></span><span class="sv">9.3</span></div>
|
||||||
|
<div class="srow"><span class="sl">UX & polish</span><span class="sb"><span class="sf hi" style="width:87%"></span></span><span class="sv">8.7</span></div>
|
||||||
|
<div class="srow"><span class="sl">Robustness & error handling</span><span class="sb"><span class="sf" style="width:75%"></span></span><span class="sv">7.5</span></div>
|
||||||
|
<div class="srow"><span class="sl">Code organization</span><span class="sb"><span class="sf lo" style="width:55%"></span></span><span class="sv">5.5</span></div>
|
||||||
|
<div class="srow"><span class="sl">Maintainability</span><span class="sb"><span class="sf lo" style="width:58%"></span></span><span class="sv">5.8</span></div>
|
||||||
|
<div class="srow"><span class="sl">Testing</span><span class="sb"><span class="sf lo" style="width:48%"></span></span><span class="sv">4.8</span></div>
|
||||||
|
<div class="srow"><span class="sl">Documentation accuracy</span><span class="sb"><span class="sf vlo" style="width:38%"></span></span><span class="sv">3.8</span></div>
|
||||||
|
<div class="overall"><span class="num">7.1</span><span class="ot"><strong style="color:var(--text)">Strong, with cleanup debt.</strong><br>An impressive core wrapped in organizational and documentation drift. The engineering earns a high mark; the housekeeping pulls the average down.</span></div>
|
||||||
|
</div>
|
||||||
|
<div class="verdict" style="margin-top:30px">
|
||||||
|
<p class="vh">Final word</p>
|
||||||
|
<p>Win Dictation is a <strong>good codebase — at its core, an impressive one</strong>. 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.</p>
|
||||||
|
<p>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.</p>
|
||||||
|
</div>
|
||||||
|
<div class="footer">
|
||||||
|
<b>Win Dictation — Architecture & Engineering Review</b><br>
|
||||||
|
Native Win32 C++ · GDI+ · SDL2 · whisper.cpp · CPU-only · target Intel i5-7th-gen (2C/4T)<br>
|
||||||
|
Assessment based on a full read of the current source tree.
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
document.addEventListener('keydown', function(e) {
|
||||||
|
if (e.key === 'Escape' && window.parent !== window) {
|
||||||
|
window.parent.postMessage({ type: 'close-fullscreen' }, '*');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- broken-img-handler -->
|
||||||
|
<script>
|
||||||
|
(function(){
|
||||||
|
if(window.__brokenImgHandler)return;
|
||||||
|
window.__brokenImgHandler=true;
|
||||||
|
var MAX=5,DELAYS=[2000,4000,8000,16000,32000];
|
||||||
|
document.addEventListener('error',function(e){
|
||||||
|
var img=e.target;
|
||||||
|
if(!img||img.tagName!=='IMG')return;
|
||||||
|
var liveSrc=img.getAttribute('src');
|
||||||
|
var src=img.dataset.haOriginalSrc||liveSrc;
|
||||||
|
if(!src)return;
|
||||||
|
if(img.dataset.haOriginalSrc&&liveSrc&&liveSrc!==img.dataset.haOriginalSrc&&liveSrc.indexOf('_r=')<0){src=liveSrc;img.dataset.haOriginalSrc=src;img.dataset.haRetryCount='0'}
|
||||||
|
else if(!img.dataset.haOriginalSrc){img.dataset.haOriginalSrc=src}
|
||||||
|
var attempt=parseInt(img.dataset.haRetryCount||'0',10);
|
||||||
|
if(img.dataset.haPhId){var old=document.getElementById(img.dataset.haPhId);if(old)old.remove()}
|
||||||
|
var ph=document.createElement('div');
|
||||||
|
ph.className='ha-img-placeholder'+(attempt>=MAX?' ha-failed':'');
|
||||||
|
ph.id='ha-ph-'+Math.random().toString(36).slice(2,9);
|
||||||
|
var w=img.getAttribute('width');var h=img.getAttribute('height');
|
||||||
|
if(w)ph.style.width=w+(isNaN(Number(w))?'':'px');
|
||||||
|
else if(img.style.width)ph.style.width=img.style.width;
|
||||||
|
else if(img.width>1)ph.style.width=img.width+'px';
|
||||||
|
if(h)ph.style.height=h+(isNaN(Number(h))?'':'px');
|
||||||
|
else if(img.style.height)ph.style.height=img.style.height;
|
||||||
|
else if(img.height>1)ph.style.height=img.height+'px';
|
||||||
|
ph.textContent=attempt>=MAX?'Image unavailable':'Loading image\u2026';
|
||||||
|
img.dataset.haPhId=ph.id;
|
||||||
|
if(img.dataset.haOrigDisplay==null)img.dataset.haOrigDisplay=img.style.display||'';
|
||||||
|
img.style.display='none';
|
||||||
|
img.insertAdjacentElement('afterend',ph);
|
||||||
|
if(attempt<MAX){
|
||||||
|
img.dataset.haRetryCount=String(attempt+1);
|
||||||
|
setTimeout(function(){
|
||||||
|
if(!img.isConnected)return;
|
||||||
|
if(img.dataset.haOriginalSrc!==src)return;
|
||||||
|
if(img.complete&&img.naturalWidth>0)return;
|
||||||
|
var curSrc=img.getAttribute('src');
|
||||||
|
if(curSrc&&curSrc.indexOf(src)!==0)return;
|
||||||
|
var fresh=src+(src.indexOf('?')>=0?'&':'?')+'_r='+(attempt+1)+'_'+Date.now();
|
||||||
|
img.src=fresh;
|
||||||
|
},DELAYS[attempt]);
|
||||||
|
}
|
||||||
|
},true);
|
||||||
|
document.addEventListener('load',function(e){
|
||||||
|
var img=e.target;
|
||||||
|
if(!img||img.tagName!=='IMG')return;
|
||||||
|
if(img.dataset.haPhId){
|
||||||
|
var ph=document.getElementById(img.dataset.haPhId);
|
||||||
|
if(ph)ph.remove();
|
||||||
|
delete img.dataset.haPhId;
|
||||||
|
img.style.display=img.dataset.haOrigDisplay||'';
|
||||||
|
delete img.dataset.haOrigDisplay;
|
||||||
|
delete img.dataset.haOriginalSrc;
|
||||||
|
delete img.dataset.haRetryCount;
|
||||||
|
}
|
||||||
|
},true);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+567
@@ -0,0 +1,567 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Win Dictation — User Manual</title>
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
||||||
|
<style>
|
||||||
|
:root{
|
||||||
|
--bg:#0E1014; --card:#16191F; --card-hi:#1E222B; --card-lo:#12151B;
|
||||||
|
--text:#ECEEF2; --dim:#8A909C; --faint:#5A606C;
|
||||||
|
--accent:#6E8BFF; --accent-hi:#839CFF; --danger:#FF5C5C; --good:#46D39A;
|
||||||
|
--border:#262B36; --hair:rgba(255,255,255,.06);
|
||||||
|
--mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
|
||||||
|
--sans:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
|
||||||
|
}
|
||||||
|
*{box-sizing:border-box}
|
||||||
|
html{scroll-behavior:smooth}
|
||||||
|
body{
|
||||||
|
margin:0; background:var(--bg); color:var(--text);
|
||||||
|
font-family:var(--sans); font-size:16.5px; line-height:1.72;
|
||||||
|
-webkit-font-smoothing:antialiased; letter-spacing:.1px;
|
||||||
|
}
|
||||||
|
.wrap{max-width:940px; margin:0 auto; padding:0 6vw 140px;}
|
||||||
|
a{color:var(--accent-hi); text-decoration:none}
|
||||||
|
a:hover{text-decoration:underline}
|
||||||
|
|
||||||
|
/* Hero */
|
||||||
|
.hero{padding:88px 0 30px; border-bottom:1px solid var(--border); margin-bottom:54px}
|
||||||
|
.eyebrow{font-family:var(--mono); font-size:12.5px; letter-spacing:.32em; text-transform:uppercase; color:var(--accent); margin:0 0 20px}
|
||||||
|
.brandrow{display:flex; align-items:center; gap:18px; margin-bottom:22px}
|
||||||
|
.glyph{width:54px;height:54px;border-radius:14px;flex:none;
|
||||||
|
background:linear-gradient(150deg,#6E8BFF,#4D67E0);
|
||||||
|
display:flex;align-items:center;justify-content:center;
|
||||||
|
box-shadow:0 8px 30px rgba(110,139,255,.35), inset 0 1px 0 rgba(255,255,255,.25)}
|
||||||
|
.glyph svg{width:28px;height:28px}
|
||||||
|
h1{font-size:clamp(34px,6vw,54px); line-height:1.04; margin:0; font-weight:800; letter-spacing:-1.2px}
|
||||||
|
.sub{font-size:20px; color:var(--dim); max-width:660px; margin:18px 0 0; font-weight:400}
|
||||||
|
.metarow{display:flex; flex-wrap:wrap; gap:10px; margin-top:30px}
|
||||||
|
.chip{font-family:var(--mono); font-size:12.5px; color:var(--dim);
|
||||||
|
background:var(--card); border:1px solid var(--border); border-radius:999px; padding:7px 15px}
|
||||||
|
.chip b{color:var(--text); font-weight:600}
|
||||||
|
|
||||||
|
/* TOC */
|
||||||
|
.toc{background:linear-gradient(180deg,var(--card),var(--card-lo));
|
||||||
|
border:1px solid var(--border); border-radius:18px; padding:30px 34px; margin-bottom:62px;
|
||||||
|
box-shadow:0 1px 0 var(--hair) inset}
|
||||||
|
.toc h4{margin:0 0 18px; font-family:var(--mono); font-size:12px; letter-spacing:.28em; text-transform:uppercase; color:var(--faint)}
|
||||||
|
.toc ol{margin:0; padding:0; list-style:none; counter-reset:t;
|
||||||
|
columns:2; column-gap:46px}
|
||||||
|
.toc li{counter-increment:t; padding:7px 0; break-inside:avoid}
|
||||||
|
.toc li a{color:var(--text); font-weight:500; font-size:15.5px}
|
||||||
|
.toc li a::before{content:counter(t,decimal-leading-zero); font-family:var(--mono); color:var(--accent);
|
||||||
|
font-size:12px; margin-right:13px; font-weight:600}
|
||||||
|
|
||||||
|
/* Sections */
|
||||||
|
section{margin:0 0 70px; scroll-margin-top:30px}
|
||||||
|
.sec-h{display:flex; align-items:baseline; gap:16px; margin:0 0 8px}
|
||||||
|
.sec-n{font-family:var(--mono); font-size:14px; color:var(--accent); font-weight:600; flex:none}
|
||||||
|
h2{font-size:29px; font-weight:700; margin:0; letter-spacing:-.5px}
|
||||||
|
h3{font-size:19px; font-weight:650; margin:36px 0 12px; letter-spacing:-.2px; color:var(--text)}
|
||||||
|
.lead{color:var(--dim); font-size:18px; margin:0 0 26px; max-width:720px}
|
||||||
|
p{margin:0 0 17px}
|
||||||
|
.muted{color:var(--dim)}
|
||||||
|
strong{color:#fff; font-weight:650}
|
||||||
|
ul,ol{margin:0 0 18px; padding-left:22px}
|
||||||
|
li{margin:9px 0}
|
||||||
|
hr.soft{border:0;border-top:1px solid var(--border);margin:42px 0}
|
||||||
|
|
||||||
|
kbd{font-family:var(--mono); font-size:13px; background:var(--card-hi);
|
||||||
|
border:1px solid var(--border); border-bottom-color:#000; border-radius:7px;
|
||||||
|
padding:3px 9px; color:var(--text); white-space:nowrap; box-shadow:0 2px 0 rgba(0,0,0,.4)}
|
||||||
|
code{font-family:var(--mono); font-size:14px; background:var(--card-hi); color:#cfe0ff;
|
||||||
|
padding:2px 7px; border-radius:6px; border:1px solid var(--border)}
|
||||||
|
.path{font-family:var(--mono); font-size:13.5px; color:var(--good)}
|
||||||
|
|
||||||
|
/* App mockup */
|
||||||
|
.stage{background:radial-gradient(120% 120% at 50% 0%, #1a1d26 0%, #0b0d11 70%);
|
||||||
|
border:1px solid var(--border); border-radius:20px; padding:46px 30px; margin:8px 0 14px;
|
||||||
|
display:flex; justify-content:center}
|
||||||
|
.appwin{width:380px; max-width:100%; background:var(--bg); border:1px solid #2a2f3a;
|
||||||
|
border-radius:12px; overflow:hidden; box-shadow:0 30px 70px rgba(0,0,0,.6); font-size:14px}
|
||||||
|
.titlebar{display:flex; align-items:center; gap:9px; padding:9px 12px; background:#0b0d11; border-bottom:1px solid #1c2027}
|
||||||
|
.titlebar .ic{width:15px;height:15px;border-radius:4px;background:linear-gradient(150deg,#6E8BFF,#4D67E0)}
|
||||||
|
.titlebar .tt{color:var(--dim); font-size:12.5px}
|
||||||
|
.titlebar .tw{margin-left:auto; color:var(--faint); letter-spacing:3px; font-size:12px}
|
||||||
|
.appbody{padding:16px}
|
||||||
|
.rrow{display:flex; gap:9px; margin-bottom:13px}
|
||||||
|
.rec{flex:1; background:linear-gradient(180deg,#7a93ff,#6E8BFF); border-radius:999px;
|
||||||
|
display:flex; align-items:center; gap:11px; padding:11px 18px; color:#fff; font-weight:600; position:relative}
|
||||||
|
.rec .d{width:13px;height:13px;border-radius:50%;background:#fff}
|
||||||
|
.chipbtn{width:42px; border-radius:10px; background:var(--card); border:1px solid var(--border);
|
||||||
|
display:flex; align-items:center; justify-content:center; position:relative}
|
||||||
|
.chipbtn svg{width:17px;height:17px}
|
||||||
|
.chipbtn.on svg{color:var(--accent)}
|
||||||
|
.stat{color:var(--dim); font-size:12.5px; margin:2px 2px 13px; position:relative}
|
||||||
|
.tbox{background:var(--card); border:1px solid var(--border); border-radius:12px;
|
||||||
|
padding:14px 15px; min-height:104px; color:var(--text); font-size:13.5px; line-height:1.5; position:relative;
|
||||||
|
box-shadow:0 1px 0 var(--hair) inset}
|
||||||
|
.srow{display:flex; gap:9px; margin:13px 0}
|
||||||
|
.sel{flex:1; background:var(--card); border:1px solid var(--border); border-radius:10px;
|
||||||
|
padding:10px 13px; color:var(--text); font-size:12.5px; display:flex; align-items:center; position:relative}
|
||||||
|
.sel .cv{margin-left:auto; color:var(--dim)}
|
||||||
|
.arow{display:flex; justify-content:space-around; padding:8px 0 2px; color:var(--dim); font-size:13.5px; position:relative}
|
||||||
|
.anno{position:absolute; top:-9px; right:-9px; width:21px;height:21px; border-radius:50%;
|
||||||
|
background:var(--accent); color:#fff; font-family:var(--mono); font-size:11.5px; font-weight:700;
|
||||||
|
display:flex; align-items:center; justify-content:center; box-shadow:0 2px 8px rgba(0,0,0,.5); z-index:3}
|
||||||
|
.anno.l{left:-9px; right:auto}
|
||||||
|
.arow .anno{top:-4px; right:8px}
|
||||||
|
|
||||||
|
.legend{display:grid; grid-template-columns:1fr 1fr; gap:13px 30px; margin:24px 0 0}
|
||||||
|
.legend .li{display:flex; gap:13px; align-items:flex-start}
|
||||||
|
.legend .bn{flex:none; width:22px;height:22px;border-radius:50%; background:var(--accent); color:#fff;
|
||||||
|
font-family:var(--mono); font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center; margin-top:2px}
|
||||||
|
.legend .lt{font-size:14.5px; color:var(--dim)}
|
||||||
|
.legend .lt b{display:block; color:var(--text); font-weight:600; margin-bottom:1px; font-size:15px}
|
||||||
|
|
||||||
|
/* Steps */
|
||||||
|
.steps{counter-reset:s; margin:0; padding:0; list-style:none}
|
||||||
|
.steps li{counter-increment:s; position:relative; padding:0 0 26px 60px; margin:0}
|
||||||
|
.steps li:not(:last-child)::after{content:""; position:absolute; left:21px; top:42px; bottom:6px; width:2px; background:var(--border)}
|
||||||
|
.steps li::before{content:counter(s); position:absolute; left:0; top:0; width:43px;height:43px;border-radius:12px;
|
||||||
|
background:var(--card); border:1px solid var(--border); color:var(--accent); font-family:var(--mono); font-weight:700; font-size:17px;
|
||||||
|
display:flex; align-items:center; justify-content:center}
|
||||||
|
.steps h4{margin:6px 0 5px; font-size:17.5px; font-weight:650}
|
||||||
|
.steps p{margin:0; color:var(--dim); font-size:15.5px}
|
||||||
|
|
||||||
|
/* Callouts */
|
||||||
|
.note{border:1px solid var(--border); border-left:3px solid var(--accent);
|
||||||
|
background:linear-gradient(90deg,rgba(110,139,255,.08),transparent 60%); border-radius:12px; padding:17px 20px; margin:22px 0}
|
||||||
|
.note.warn{border-left-color:var(--danger); background:linear-gradient(90deg,rgba(255,92,92,.08),transparent 60%)}
|
||||||
|
.note.good{border-left-color:var(--good); background:linear-gradient(90deg,rgba(70,211,154,.08),transparent 60%)}
|
||||||
|
.note .nt{font-family:var(--mono); font-size:11.5px; letter-spacing:.18em; text-transform:uppercase; color:var(--dim); margin:0 0 6px}
|
||||||
|
.note p:last-child{margin:0}
|
||||||
|
|
||||||
|
/* Tables */
|
||||||
|
.tbl{width:100%; border-collapse:collapse; margin:18px 0; font-size:15px; overflow:hidden; border-radius:12px; border:1px solid var(--border)}
|
||||||
|
.tbl th{text-align:left; font-family:var(--mono); font-size:11.5px; letter-spacing:.12em; text-transform:uppercase;
|
||||||
|
color:var(--dim); padding:13px 16px; background:var(--card-lo); border-bottom:1px solid var(--border); font-weight:600}
|
||||||
|
.tbl td{padding:13px 16px; border-bottom:1px solid var(--border); vertical-align:top; color:var(--text)}
|
||||||
|
.tbl tr:last-child td{border-bottom:0}
|
||||||
|
.tbl tr:nth-child(even) td{background:rgba(255,255,255,.012)}
|
||||||
|
.tbl td .sm{color:var(--dim); font-size:13.5px}
|
||||||
|
.tag{font-family:var(--mono); font-size:12px; padding:2px 9px; border-radius:6px; white-space:nowrap}
|
||||||
|
.tag.fast{background:rgba(70,211,154,.14); color:var(--good)}
|
||||||
|
.tag.bal{background:rgba(110,139,255,.14); color:var(--accent-hi)}
|
||||||
|
.tag.slow{background:rgba(255,92,92,.14); color:var(--danger)}
|
||||||
|
|
||||||
|
/* Feature grid */
|
||||||
|
.grid{display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:24px 0}
|
||||||
|
.fcard{background:var(--card); border:1px solid var(--border); border-radius:14px; padding:22px; box-shadow:0 1px 0 var(--hair) inset}
|
||||||
|
.fcard .fi{width:38px;height:38px;border-radius:10px;background:var(--card-hi); display:flex;align-items:center;justify-content:center; margin-bottom:14px}
|
||||||
|
.fcard .fi svg{width:20px;height:20px;color:var(--accent)}
|
||||||
|
.fcard h4{margin:0 0 7px; font-size:16.5px; font-weight:650}
|
||||||
|
.fcard p{margin:0; color:var(--dim); font-size:14.5px; line-height:1.6}
|
||||||
|
|
||||||
|
.kv{display:flex; gap:14px; padding:14px 0; border-bottom:1px solid var(--border)}
|
||||||
|
.kv:last-child{border-bottom:0}
|
||||||
|
.kv .k{flex:none; width:190px}
|
||||||
|
.kv .k kbd{font-size:13px}
|
||||||
|
.kv .v{color:var(--dim); font-size:15.5px}
|
||||||
|
|
||||||
|
.footer{border-top:1px solid var(--border); margin-top:80px; padding-top:30px; color:var(--faint); font-size:13.5px; font-family:var(--mono)}
|
||||||
|
.footer b{color:var(--dim); font-weight:500}
|
||||||
|
|
||||||
|
@media(max-width:680px){
|
||||||
|
.toc ol{columns:1}
|
||||||
|
.grid,.legend{grid-template-columns:1fr}
|
||||||
|
.kv{flex-direction:column; gap:4px}
|
||||||
|
.kv .k{width:auto}
|
||||||
|
body{font-size:16px}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style>
|
||||||
|
.ha-img-placeholder{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;background:#f4f4f5;border:1px dashed #d4d4d8;border-radius:8px;color:#71717a;font-size:12px;font-family:system-ui,sans-serif;min-height:80px;padding:16px;box-sizing:border-box;animation:ha-img-pulse 1.5s ease-in-out infinite}
|
||||||
|
.ha-img-placeholder.ha-failed{animation:none;opacity:.7}
|
||||||
|
@keyframes ha-img-pulse{0%,100%{opacity:1}50%{opacity:.5}}
|
||||||
|
@media(prefers-color-scheme:dark){.ha-img-placeholder{background:#27272a;border-color:#3f3f46;color:#a1a1aa}}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="wrap">
|
||||||
|
|
||||||
|
<!-- HERO -->
|
||||||
|
<header class="hero">
|
||||||
|
<p class="eyebrow">User Manual · v3</p>
|
||||||
|
<div class="brandrow">
|
||||||
|
<div class="glyph">
|
||||||
|
<svg viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3z"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><line x1="12" y1="19" x2="12" y2="23"/></svg>
|
||||||
|
</div>
|
||||||
|
<h1>Win Dictation</h1>
|
||||||
|
</div>
|
||||||
|
<p class="sub">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.</p>
|
||||||
|
<div class="metarow">
|
||||||
|
<span class="chip"><b>Offline</b> · runs on your machine</span>
|
||||||
|
<span class="chip"><b>Hotkey</b> Ctrl+Shift+Space</span>
|
||||||
|
<span class="chip"><b>CPU-only</b> · no GPU required</span>
|
||||||
|
<span class="chip"><b>Whisper</b> · tiny.en → small.en</span>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<!-- TOC -->
|
||||||
|
<nav class="toc">
|
||||||
|
<h4>Contents</h4>
|
||||||
|
<ol>
|
||||||
|
<li><a href="#what">What Win Dictation is</a></li>
|
||||||
|
<li><a href="#quick">Quick start in 60 seconds</a></li>
|
||||||
|
<li><a href="#tour">The interface, explained</a></li>
|
||||||
|
<li><a href="#workflow">How dictation works</a></li>
|
||||||
|
<li><a href="#hotkeys">Keyboard & hotkeys</a></li>
|
||||||
|
<li><a href="#autopaste">Auto-paste & the active window</a></li>
|
||||||
|
<li><a href="#history">History & sessions</a></li>
|
||||||
|
<li><a href="#models">Models & the Settings screen</a></li>
|
||||||
|
<li><a href="#tray">System tray & options</a></li>
|
||||||
|
<li><a href="#stats">Your statistics</a></li>
|
||||||
|
<li><a href="#tips">Tips for best results</a></li>
|
||||||
|
<li><a href="#trouble">Troubleshooting</a></li>
|
||||||
|
<li><a href="#faq">FAQ & where things live</a></li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<!-- 1 -->
|
||||||
|
<section id="what">
|
||||||
|
<div class="sec-h"><span class="sec-n">01</span><h2>What Win Dictation is</h2></div>
|
||||||
|
<p class="lead">A small, focused desktop tool that turns your voice into text anywhere on Windows — no browser, no cloud, no account.</p>
|
||||||
|
<p>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.</p>
|
||||||
|
<p>Everything happens <strong>on your computer</strong>. The audio never leaves the machine; transcription runs locally using <a href="https://github.com/ggerganov/whisper.cpp" target="_blank" rel="noopener noreferrer">whisper.cpp</a>, 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.</p>
|
||||||
|
<div class="note good">
|
||||||
|
<p class="nt">Built for modest hardware</p>
|
||||||
|
<p>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.</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 2 -->
|
||||||
|
<section id="quick">
|
||||||
|
<div class="sec-h"><span class="sec-n">02</span><h2>Quick start in 60 seconds</h2></div>
|
||||||
|
<p class="lead">Three steps. No setup, no sign-in.</p>
|
||||||
|
<ol class="steps">
|
||||||
|
<li>
|
||||||
|
<h4>Launch <span class="path">win-dictation.exe</span></h4>
|
||||||
|
<p>The window opens and a microphone icon appears in your system tray. Wait a moment for the status line to change from <em>“Loading model…”</em> to <strong>“Ready”</strong>.</p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<h4>Click into wherever you want the text, then press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Space</kbd></h4>
|
||||||
|
<p>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.</p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<h4>Speak, then press the hotkey again</h4>
|
||||||
|
<p>Talk naturally. When you’re done, press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Space</kbd> once more. A short progress bar runs, and your words appear — pasted straight into the app you were using.</p>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
<div class="note">
|
||||||
|
<p class="nt">That's the whole loop</p>
|
||||||
|
<p>Press to start, speak, press to finish. The text is on your clipboard <em>and</em> dropped into your previous window. You never have to click back into Win Dictation.</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 3 -->
|
||||||
|
<section id="tour">
|
||||||
|
<div class="sec-h"><span class="sec-n">03</span><h2>The interface, explained</h2></div>
|
||||||
|
<p class="lead">The whole app is a single window. Here is every control on it.</p>
|
||||||
|
|
||||||
|
<div class="stage">
|
||||||
|
<div class="appwin">
|
||||||
|
<div class="titlebar"><span class="ic"></span><span class="tt">Dictation</span><span class="tw">— ▢ ✕</span></div>
|
||||||
|
<div class="appbody">
|
||||||
|
<div class="rrow">
|
||||||
|
<div class="rec"><span class="d"></span>Record<span class="anno">1</span></div>
|
||||||
|
<div class="chipbtn on"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4v6l-2 4v2h10v-2l-2-4V4"/><line x1="12" y1="16" x2="12" y2="22"/><line x1="8" y1="4" x2="16" y2="4"/></svg><span class="anno">2</span></div>
|
||||||
|
<div class="chipbtn"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg><span class="anno">3</span></div>
|
||||||
|
</div>
|
||||||
|
<div class="stat">Ready • 2 threads<span class="anno">4</span></div>
|
||||||
|
<div class="tbox">Win-dictate is a desktop, whisper powered, speech to text application!<span class="anno">5</span></div>
|
||||||
|
<div class="srow">
|
||||||
|
<div class="sel">Microphone (Realtek Audio)<span class="cv">⌄</span><span class="anno">6</span></div>
|
||||||
|
<div class="sel">History<span class="cv">⌄</span><span class="anno">7</span></div>
|
||||||
|
</div>
|
||||||
|
<div class="arow"><span>Copy</span><span>Paste</span><span>Clear</span><span class="anno">8</span></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="legend">
|
||||||
|
<div class="li"><span class="bn">1</span><span class="lt"><b>Record / Stop</b>The big pill. Click to start; it turns red and reads “Stop” while recording. Same as the hotkey.</span></div>
|
||||||
|
<div class="li"><span class="bn">2</span><span class="lt"><b>Pin</b>Keeps the window always on top. Blue when active. On by default.</span></div>
|
||||||
|
<div class="li"><span class="bn">3</span><span class="lt"><b>Settings (cog)</b>Opens the Settings screen for choosing and downloading models, and viewing your stats.</span></div>
|
||||||
|
<div class="li"><span class="bn">4</span><span class="lt"><b>Status line</b>Shows “Ready” and the thread count when idle, a timer while recording, and a live countdown while transcribing.</span></div>
|
||||||
|
<div class="li"><span class="bn">5</span><span class="lt"><b>Transcript box</b>Where text appears. You can <strong>edit it freely</strong> — click in and type, fix, or delete.</span></div>
|
||||||
|
<div class="li"><span class="bn">6</span><span class="lt"><b>Microphone selector</b>Choose which input device to record from. Opens a dropdown of all your mics.</span></div>
|
||||||
|
<div class="li"><span class="bn">7</span><span class="lt"><b>History</b>Opens a list of past dictation sessions you can reload — or delete individually.</span></div>
|
||||||
|
<div class="li"><span class="bn">8</span><span class="lt"><b>Copy · Paste · Clear</b>Copy the transcript, paste it into your last window, or clear the box (saving it to history first).</span></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>The status line is your dashboard</h3>
|
||||||
|
<p>That one line of dim text under the Record button tells you everything about the app's state:</p>
|
||||||
|
<table class="tbl">
|
||||||
|
<tr><th>You see</th><th>It means</th></tr>
|
||||||
|
<tr><td><code>Loading model…</code></td><td>Starting up — the speech model is being read into memory. Wait a second.</td></tr>
|
||||||
|
<tr><td><code>Ready · 2 threads</code></td><td>Idle and ready to record. The number is how many CPU threads it will use.</td></tr>
|
||||||
|
<tr><td><code>Recording 0:14</code></td><td>Listening. The timer counts how long you've been speaking. A green level meter pulses with your voice.</td></tr>
|
||||||
|
<tr><td><code>Transcribing 0:14 · 62% · 3s left</code></td><td>Working on your audio. The bar fills and the countdown ticks <em>down</em> to zero.</td></tr>
|
||||||
|
<tr><td><code>Pasted</code> / <code>Copied</code></td><td>Done. Your text went to the clipboard (and into your previous window if auto-paste is on).</td></tr>
|
||||||
|
<tr><td><code>No speech detected</code></td><td>The clip was silent or too short to transcribe. Nothing was added.</td></tr>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 4 -->
|
||||||
|
<section id="workflow">
|
||||||
|
<div class="sec-h"><span class="sec-n">04</span><h2>How dictation works</h2></div>
|
||||||
|
<p class="lead">Win Dictation is <strong>push-to-talk</strong>, not live streaming. You record a whole clip, then it transcribes the whole thing at once.</p>
|
||||||
|
<p>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.</p>
|
||||||
|
|
||||||
|
<h3>What happens when you record</h3>
|
||||||
|
<ol>
|
||||||
|
<li><strong>You press the hotkey.</strong> The app remembers which window you were in, and where your text cursor was sitting inside the transcript box.</li>
|
||||||
|
<li><strong>It records.</strong> Audio is captured at 16 kHz and held in memory. CPU use stays near zero. The level meter shows it's hearing you.</li>
|
||||||
|
<li><strong>You press the hotkey again.</strong> Recording stops. Silence at the start and end of your clip is trimmed away automatically.</li>
|
||||||
|
<li><strong>It transcribes.</strong> The full clip is run through Whisper once. The progress bar shows a smooth, self-calibrating estimate of how long it will take.</li>
|
||||||
|
<li><strong>The text lands.</strong> 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.</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<div class="note">
|
||||||
|
<p class="nt">There is no “stop on silence”</p>
|
||||||
|
<p>Recording continues until <em>you</em> 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 <strong>10 minutes</strong> per clip.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>The transcript box is editable</h3>
|
||||||
|
<p>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 <strong>at your cursor</strong> — so you can build up a document piece by piece, placing each new chunk exactly where you want it.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 5 -->
|
||||||
|
<section id="hotkeys">
|
||||||
|
<div class="sec-h"><span class="sec-n">05</span><h2>Keyboard & hotkeys</h2></div>
|
||||||
|
<p class="lead">Two global shortcuts work from anywhere in Windows, even when the window is hidden.</p>
|
||||||
|
<div class="kv"><div class="k"><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Space</kbd></div><div class="v"><strong>Start / stop recording.</strong> The core hotkey. Press once to begin, once more to transcribe. If a transcription is already running, pressing it again cancels it.</div></div>
|
||||||
|
<div class="kv"><div class="k"><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>H</kbd></div><div class="v"><strong>Hide the window.</strong> Tucks Win Dictation away to the tray (and cancels any recording in progress). The hotkeys still work while hidden.</div></div>
|
||||||
|
<div class="kv"><div class="k"><kbd>Esc</kbd> <span class="muted">(in a dropdown)</span></div><div class="v">Closes an open Microphone or History popup without choosing anything.</div></div>
|
||||||
|
<div class="kv"><div class="k"><kbd>Delete</kbd> <span class="muted">(in History)</span></div><div class="v">Deletes the history entry you're hovering over.</div></div>
|
||||||
|
<div class="note warn">
|
||||||
|
<p class="nt">If the hotkey doesn't work</p>
|
||||||
|
<p>You may see <code>Hotkey in use — edit win-dictation.ini</code>. That means another program already grabbed <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Space</kbd>. You can change it by editing the <code>hkMods</code> and <code>hkVk</code> values in the <span class="path">win-dictation.ini</span> file (see the <a href="#faq">FAQ</a>).</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 6 -->
|
||||||
|
<section id="autopaste">
|
||||||
|
<div class="sec-h"><span class="sec-n">06</span><h2>Auto-paste & the active window</h2></div>
|
||||||
|
<p class="lead">The feature that makes Win Dictation feel invisible: it types into <em>other</em> apps for you.</p>
|
||||||
|
<p>When you trigger recording, the app notes which window had focus a moment before. After transcription, if <strong>Auto-paste</strong> 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.</p>
|
||||||
|
<p>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 <strong>Paste</strong> button will send it to your last window on demand.</p>
|
||||||
|
<div class="note">
|
||||||
|
<p class="nt">Pair it with Auto-hide</p>
|
||||||
|
<p>Turn on <strong>Auto-hide</strong> (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.</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 7 -->
|
||||||
|
<section id="history">
|
||||||
|
<div class="sec-h"><span class="sec-n">07</span><h2>History & sessions</h2></div>
|
||||||
|
<p class="lead">Every dictation session is saved automatically, so you never lose a transcript.</p>
|
||||||
|
<p>A <strong>session</strong> 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.</p>
|
||||||
|
|
||||||
|
<h3>Browsing and reloading</h3>
|
||||||
|
<p>Click the <strong>History</strong> 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 <strong>100</strong> sessions are kept (older ones are pruned automatically).</p>
|
||||||
|
|
||||||
|
<h3>Deleting entries</h3>
|
||||||
|
<p>Hover over any history row and a small <strong>✕</strong> appears on its right edge — click it to delete that session's file. You can also press <kbd>Delete</kbd> on the hovered row. The list <em>stays open</em> after each delete so you can tidy up several at once. The window even shrinks to fit as the list gets shorter.</p>
|
||||||
|
<div class="note warn">
|
||||||
|
<p class="nt">Deletion is permanent</p>
|
||||||
|
<p>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 <span class="path">history\</span> folder next to the program, if you ever want to back them up.</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 8 -->
|
||||||
|
<section id="models">
|
||||||
|
<div class="sec-h"><span class="sec-n">08</span><h2>Models & the Settings screen</h2></div>
|
||||||
|
<p class="lead">A model is the AI that turns sound into words. Bigger models are more accurate but slower. Click the cog to manage them.</p>
|
||||||
|
<p>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 <strong>Download</strong> button that fetches them directly from Hugging Face with a live progress percentage.</p>
|
||||||
|
|
||||||
|
<table class="tbl">
|
||||||
|
<tr><th>Model</th><th>Size</th><th>Character</th><th></th></tr>
|
||||||
|
<tr><td><code>tiny.en</code></td><td class="sm">~75 MB</td><td class="sm">The default. Quick and light — ideal for this CPU.</td><td><span class="tag fast">fastest</span></td></tr>
|
||||||
|
<tr><td><code>tiny.en-q8_0</code></td><td class="sm">~42 MB</td><td class="sm">Same speed, smaller file (compressed).</td><td><span class="tag fast">fastest</span></td></tr>
|
||||||
|
<tr><td><code>base.en-q5_1</code></td><td class="sm">~59 MB</td><td class="sm">A noticeable accuracy bump for little cost.</td><td><span class="tag bal">good balance</span></td></tr>
|
||||||
|
<tr><td><code>base.en</code></td><td class="sm">~142 MB</td><td class="sm">More accurate; still reasonable on two cores.</td><td><span class="tag bal">balance</span></td></tr>
|
||||||
|
<tr><td><code>small.en-q5_1</code></td><td class="sm">~182 MB</td><td class="sm">Accurate, but slow on this machine.</td><td><span class="tag slow">slow here</span></td></tr>
|
||||||
|
<tr><td><code>small.en</code></td><td class="sm">~466 MB</td><td class="sm">The most accurate offered — and the slowest.</td><td><span class="tag slow">slowest</span></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3>Choosing a model</h3>
|
||||||
|
<ol>
|
||||||
|
<li>Open Settings (the cog), and find the model you want.</li>
|
||||||
|
<li>If it isn't installed, click <strong>Download</strong> and wait for it to reach 100%. You can cancel mid-download, and only one downloads at a time.</li>
|
||||||
|
<li>Click the model's row to select it (the dot fills in).</li>
|
||||||
|
<li>Click <strong>Save</strong>. The app reloads with the new model and remembers your choice. <strong>Back</strong> or <strong>Cancel</strong> discards any change.</li>
|
||||||
|
</ol>
|
||||||
|
<div class="note">
|
||||||
|
<p class="nt">A good rule of thumb</p>
|
||||||
|
<p>Stick with <code>tiny.en</code> or <code>base.en-q5_1</code> for everyday use on a two-core laptop. Step up to <code>base.en</code> if you want better accuracy and don't mind waiting a beat longer. The <code>small</code> models are best reserved for short, important clips where accuracy matters most.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>The progress bar learns your machine</h3>
|
||||||
|
<p>You'll notice the transcription countdown is unusually accurate. That's because Win Dictation <strong>measures how fast your specific computer is</strong> 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.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 9 -->
|
||||||
|
<section id="tray">
|
||||||
|
<div class="sec-h"><span class="sec-n">09</span><h2>System tray & options</h2></div>
|
||||||
|
<p class="lead">Win Dictation lives in the tray. Right-click its icon for the quick options menu.</p>
|
||||||
|
<div class="grid">
|
||||||
|
<div class="fcard"><div class="fi"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 11l3 3L22 4"/><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"/></svg></div><h4>Auto-paste</h4><p>Paste transcribed text into your previous window automatically. On by default.</p></div>
|
||||||
|
<div class="fcard"><div class="fi"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2l2.4 7.4H22l-6 4.6 2.3 7-6.3-4.6L5.7 21 8 14 2 9.4h7.6z"/></svg></div><h4>Always on top</h4><p>Keep the window above other apps. Mirrors the Pin button. On by default.</p></div>
|
||||||
|
<div class="fcard"><div class="fi"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7S2 12 2 12z"/><line x1="4" y1="4" x2="20" y2="20"/></svg></div><h4>Auto-hide</h4><p>Hide the window automatically right after it pastes. Off by default.</p></div>
|
||||||
|
<div class="fcard"><div class="fi"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></div><h4>Exit</h4><p>Fully quits the app. Closing the window only hides it to the tray — use this to stop it entirely.</p></div>
|
||||||
|
</div>
|
||||||
|
<p class="muted">Double-clicking the tray icon brings the window back. Closing the window with the <strong>✕</strong> 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.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 10 -->
|
||||||
|
<section id="stats">
|
||||||
|
<div class="sec-h"><span class="sec-n">10</span><h2>Your statistics</h2></div>
|
||||||
|
<p class="lead">Scroll down in Settings to see a running tally of your dictation habits.</p>
|
||||||
|
<p>Win Dictation quietly keeps lifetime totals and turns them into friendly figures:</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Total audio dictated</strong> and the number of clips.</li>
|
||||||
|
<li><strong>Word count</strong>, plus your average <strong>speaking pace</strong> in words per minute.</li>
|
||||||
|
<li><strong>Total processing time</strong> and your machine's <strong>real-time factor</strong> (e.g. “4× real-time” means it transcribes four seconds of audio every second).</li>
|
||||||
|
<li>Your <strong>longest single clip</strong>.</li>
|
||||||
|
<li>An estimate of the <strong>time you've saved</strong> versus typing at 40 wpm.</li>
|
||||||
|
</ul>
|
||||||
|
<p class="muted">These numbers are stored locally and are just for your own curiosity — nothing is reported anywhere.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 11 -->
|
||||||
|
<section id="tips">
|
||||||
|
<div class="sec-h"><span class="sec-n">11</span><h2>Tips for best results</h2></div>
|
||||||
|
<div class="grid">
|
||||||
|
<div class="fcard"><h4>Click first, then dictate</h4><p>Put your text cursor in the destination app <em>before</em> pressing the hotkey, so auto-paste knows where to send the words.</p></div>
|
||||||
|
<div class="fcard"><h4>Speak in natural phrases</h4><p>Whisper transcribes best with full sentences and natural rhythm. You don't need to over-enunciate or pause between words.</p></div>
|
||||||
|
<div class="fcard"><h4>Pick the right mic</h4><p>If accuracy is poor, check the Microphone selector — a headset or dedicated mic beats a distant laptop mic in a noisy room.</p></div>
|
||||||
|
<div class="fcard"><h4>Match model to task</h4><p>Quick chat replies? <code>tiny.en</code>. A careful paragraph of prose? Try <code>base.en</code> for fewer corrections.</p></div>
|
||||||
|
<div class="fcard"><h4>Edit in place</h4><p>Fix the odd misheard word right in the transcript box, then Copy — faster than re-recording the whole thing.</p></div>
|
||||||
|
<div class="fcard"><h4>Let it warm up</h4><p>The very first transcription after launch can be a touch slower as the model settles into memory. It's quick from then on.</p></div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 12 -->
|
||||||
|
<section id="trouble">
|
||||||
|
<div class="sec-h"><span class="sec-n">12</span><h2>Troubleshooting</h2></div>
|
||||||
|
<table class="tbl">
|
||||||
|
<tr><th>Symptom</th><th>What to do</th></tr>
|
||||||
|
<tr><td><b>“Model not found”</b></td><td>The selected <code>.bin</code> model file is missing. Open Settings and download a model (start with <code>tiny.en</code>), or place a <code>.bin</code> file in the <span class="path">models\</span> folder next to the program and restart.</td></tr>
|
||||||
|
<tr><td><b>“Hotkey in use”</b></td><td>Another app owns <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Space</kbd>. Change the hotkey in <span class="path">win-dictation.ini</span>, or close the conflicting app. You can still record by clicking the Record button.</td></tr>
|
||||||
|
<tr><td><b>“Microphone error”</b></td><td>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.</td></tr>
|
||||||
|
<tr><td><b>“No speech detected”</b></td><td>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.</td></tr>
|
||||||
|
<tr><td><b>Text pasted into the wrong place</b></td><td>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.</td></tr>
|
||||||
|
<tr><td><b>Transcription feels slow</b></td><td>You're likely on a larger model. Switch to <code>tiny.en</code> or <code>base.en-q5_1</code> in Settings. The <code>small</code> models are inherently slow on a two-core CPU.</td></tr>
|
||||||
|
<tr><td><b>Window vanished</b></td><td>It hid to the tray. Double-click the tray icon, press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>H</kbd>, or right-click the tray icon → Show Window.</td></tr>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 13 -->
|
||||||
|
<section id="faq">
|
||||||
|
<div class="sec-h"><span class="sec-n">13</span><h2>FAQ & where things live</h2></div>
|
||||||
|
|
||||||
|
<h3>Does my voice get sent anywhere?</h3>
|
||||||
|
<p>No. All recording and transcription happen on your computer. The only time the app reaches the internet is when <em>you</em> click Download to fetch a model file.</p>
|
||||||
|
|
||||||
|
<h3>Can it run completely offline?</h3>
|
||||||
|
<p>Yes — once you have at least one model installed, no internet is needed ever again.</p>
|
||||||
|
|
||||||
|
<h3>What languages does it support?</h3>
|
||||||
|
<p>This build is tuned for <strong>English</strong> (the <code>.en</code> models). It's optimised for accuracy and speed in English on modest hardware.</p>
|
||||||
|
|
||||||
|
<h3>Where are my files kept?</h3>
|
||||||
|
<p>Everything sits next to <span class="path">win-dictation.exe</span>:</p>
|
||||||
|
<table class="tbl">
|
||||||
|
<tr><th>Location</th><th>What's there</th></tr>
|
||||||
|
<tr><td><span class="path">models\</span></td><td>Your downloaded <code>.bin</code> speech models.</td></tr>
|
||||||
|
<tr><td><span class="path">history\</span></td><td>One text file per dictation session.</td></tr>
|
||||||
|
<tr><td><span class="path">win-dictation.ini</span></td><td>Your settings, hotkey, window position, learned timing, and statistics.</td></tr>
|
||||||
|
<tr><td><span class="path">win-dictation.log</span></td><td>A simple timestamped activity log, handy if something misbehaves.</td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3>How do I change the hotkey?</h3>
|
||||||
|
<p>Open <span class="path">win-dictation.ini</span> in any text editor and edit the <code>hkMods</code> and <code>hkVk</code> values under <code>[app]</code> (they're standard Windows key codes), then restart the app. A built-in settings option for this is a natural future addition.</p>
|
||||||
|
|
||||||
|
<h3>Why is it called “push-to-talk” if I'm not holding a button?</h3>
|
||||||
|
<p>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.</p>
|
||||||
|
|
||||||
|
<div class="footer">
|
||||||
|
<b>Win Dictation</b> · push-to-talk speech-to-text for Windows · powered by whisper.cpp (MIT)<br>
|
||||||
|
Default hotkey Ctrl+Shift+Space · CPU-only build · runs entirely offline
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
document.addEventListener('keydown', function(e) {
|
||||||
|
if (e.key === 'Escape' && window.parent !== window) {
|
||||||
|
window.parent.postMessage({ type: 'close-fullscreen' }, '*');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- broken-img-handler -->
|
||||||
|
<script>
|
||||||
|
(function(){
|
||||||
|
if(window.__brokenImgHandler)return;
|
||||||
|
window.__brokenImgHandler=true;
|
||||||
|
var MAX=5,DELAYS=[2000,4000,8000,16000,32000];
|
||||||
|
document.addEventListener('error',function(e){
|
||||||
|
var img=e.target;
|
||||||
|
if(!img||img.tagName!=='IMG')return;
|
||||||
|
var liveSrc=img.getAttribute('src');
|
||||||
|
var src=img.dataset.haOriginalSrc||liveSrc;
|
||||||
|
if(!src)return;
|
||||||
|
if(img.dataset.haOriginalSrc&&liveSrc&&liveSrc!==img.dataset.haOriginalSrc&&liveSrc.indexOf('_r=')<0){src=liveSrc;img.dataset.haOriginalSrc=src;img.dataset.haRetryCount='0'}
|
||||||
|
else if(!img.dataset.haOriginalSrc){img.dataset.haOriginalSrc=src}
|
||||||
|
var attempt=parseInt(img.dataset.haRetryCount||'0',10);
|
||||||
|
if(img.dataset.haPhId){var old=document.getElementById(img.dataset.haPhId);if(old)old.remove()}
|
||||||
|
var ph=document.createElement('div');
|
||||||
|
ph.className='ha-img-placeholder'+(attempt>=MAX?' ha-failed':'');
|
||||||
|
ph.id='ha-ph-'+Math.random().toString(36).slice(2,9);
|
||||||
|
var w=img.getAttribute('width');var h=img.getAttribute('height');
|
||||||
|
if(w)ph.style.width=w+(isNaN(Number(w))?'':'px');
|
||||||
|
else if(img.style.width)ph.style.width=img.style.width;
|
||||||
|
else if(img.width>1)ph.style.width=img.width+'px';
|
||||||
|
if(h)ph.style.height=h+(isNaN(Number(h))?'':'px');
|
||||||
|
else if(img.style.height)ph.style.height=img.style.height;
|
||||||
|
else if(img.height>1)ph.style.height=img.height+'px';
|
||||||
|
ph.textContent=attempt>=MAX?'Image unavailable':'Loading image\u2026';
|
||||||
|
img.dataset.haPhId=ph.id;
|
||||||
|
if(img.dataset.haOrigDisplay==null)img.dataset.haOrigDisplay=img.style.display||'';
|
||||||
|
img.style.display='none';
|
||||||
|
img.insertAdjacentElement('afterend',ph);
|
||||||
|
if(attempt<MAX){
|
||||||
|
img.dataset.haRetryCount=String(attempt+1);
|
||||||
|
setTimeout(function(){
|
||||||
|
if(!img.isConnected)return;
|
||||||
|
if(img.dataset.haOriginalSrc!==src)return;
|
||||||
|
if(img.complete&&img.naturalWidth>0)return;
|
||||||
|
var curSrc=img.getAttribute('src');
|
||||||
|
if(curSrc&&curSrc.indexOf(src)!==0)return;
|
||||||
|
var fresh=src+(src.indexOf('?')>=0?'&':'?')+'_r='+(attempt+1)+'_'+Date.now();
|
||||||
|
img.src=fresh;
|
||||||
|
},DELAYS[attempt]);
|
||||||
|
}
|
||||||
|
},true);
|
||||||
|
document.addEventListener('load',function(e){
|
||||||
|
var img=e.target;
|
||||||
|
if(!img||img.tagName!=='IMG')return;
|
||||||
|
if(img.dataset.haPhId){
|
||||||
|
var ph=document.getElementById(img.dataset.haPhId);
|
||||||
|
if(ph)ph.remove();
|
||||||
|
delete img.dataset.haPhId;
|
||||||
|
img.style.display=img.dataset.haOrigDisplay||'';
|
||||||
|
delete img.dataset.haOrigDisplay;
|
||||||
|
delete img.dataset.haOriginalSrc;
|
||||||
|
delete img.dataset.haRetryCount;
|
||||||
|
}
|
||||||
|
},true);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Reference in New Issue
Block a user