Py’otrMuhammad Toheed Sahar

WhisperFlow-PK: push-to-talk dictation for Urdu and English

I built a Windows dictation tool where you hold Ctrl+Alt, speak Urdu, English or a mix of both, and the text lands in whatever app you are typing in.

Client
Own product
Year
2026
Type
AI apps & ML · Featured

The problem

Most dictation tools are built English-first. I wanted to speak Urdu, English or both in one breath and get clean text in any window, without the end of a sentence going missing, Urdu coming out misspelled, or the wrong language coming back.

How I built it

Hold Ctrl+Alt, speak, release, and the text is pasted into the focused window. Audio streams live to Deepgram Nova-3 while you talk, with Groq Whisper and then a local Whisper model as fallbacks, so a dictation is not lost when the network or a service fails. Urdu comes back from the multilingual mode in Devanagari, so a converter turns it into Urdu script and a guarded language-model pass fixes the spelling. It runs as a hidden background service with a click-through overlay that never steals focus, a usage dashboard, and a benchmark harness that scores every change against my own recorded dictations.

What got hard

  1. Urdu words came back misspelled even when the speech engine had heard them correctly.

    I traced it to my own pipeline. Converting Devanagari to Urdu script loses information, because one Devanagari letter can stand for several Urdu letters that sound alike (6 of 7 test words came out wrong). I added a spelling-repair pass with a language model. A smaller model once changed a word's meaning, so the pass is guarded: a correction is accepted only if the old and new word differ by same-sounding letters and nothing else. The acceptance set came out 7 of 7 exact, English words untouched, and the repair pass took 1.34 s at the 95th percentile.

  2. On real recordings the multilingual engine sometimes returned Spanish for Urdu speech, and the app pasted it. It happened on 3 of 12 real clips I scored.

    My first idea was to normalise the loudness, and I tested it: the Spanish opening did not change. Streaming results carry a language tag per word, so I gate on that instead. If at least 35% of the tagged words fall outside Hindi and English, the whole recording is re-transcribed once with Urdu forced. On one real clip the Spanish opening became proper Urdu. Forcing Urdu for every dictation scored about four times worse on my real recordings, so the re-route stays conditional.

  3. The cloud fallback took 17 seconds to transcribe a short clip.

    A test ruled out my first suspect, the HTTP User-Agent. The cause was building a new API client inside the key-rotation loop, so every attempt paid a fresh TLS handshake. Caching one client per key brought a 5 second clip to 1.03 s and a 30 second clip to 1.31 s.

  4. Speech was lost or scrambled in edge cases. In test runs the audio reached the speech service out of order in 20 of 20 trials, and the old 60 second cap had silently cut 64 of 805 logged dictations.

    One dispatch thread now sends audio in capture order (0 of 60 trials out of order). The cap is 20 minutes with a warning in the last minute, and a stream that breaks mid-dictation re-transcribes the whole recording through the fallbacks, so the app never pastes empty text when words were heard.

  5. The offline fallback crashed on every empty cloud result. My multilingual setting is not a valid language code for local Whisper, so each empty result threw an error (21 crashes in the log between 10 and 15 August).

    Those settings now map to auto-detect, and any other invalid code is checked against the library's own list of 100 codes before it is used. A review run re-checked the log and saw no crashes after the fix.

  6. Pasting destroyed whatever was on the clipboard, and two dictations in quick succession could paste one twice and lose the other.

    The paste path snapshots and restores every clipboard format, so a copied file survives a dictation, and deliveries are ordered and locked. A 64-bit pointer bug in the clipboard code showed up live as an access violation and is fixed.

The result

In my own use between 19 August and 3 October 2026 it completed 296 dictations (about 17,400 words) over 11 days, mostly into a code editor and terminals: 258 through the cloud engine, 25 through the first fallback and 13 through local Whisper. The test suite stood at 117 passing at the last logged check.