Write to us

AI, Privacy

Offline dictation on Windows: how we built ours

How we built a voice typing tool for Windows that works without the internet, cleans up its words with fixed rules, and keeps Arabic terms in Arabic script.

You can have dictation on Windows without sending your voice to a server, by running an open speech recognition model on your own computer, ideally on its graphics card, and tidying up the result there with fixed rules. That is how we built our own voice typing tool. You double tap the Ctrl key, speak, and double tap again, and the words appear wherever your cursor is, in any program. Every part of it, from the speech model to the clean-up and the history page, runs on the computer, and none of it is built to send anything elsewhere, so it works the same with or without a connection.

Why dictation should stay on your computer

Many dictation services work by recording your voice, sending it to a server to be turned into text, and sending the text back. That works well enough, but it means a copy of what you say passes through someone else’s computer. What people dictate is often private, such as emails, notes, messages to family and drafts of work for clients, and we wanted a tool built so that none of it has to leave the computer.

There were practical reasons too. A tool that runs on the computer keeps working on a poor connection or with none at all, and it does not slow down when a distant service is busy. We also wanted it to handle the way many Muslims actually speak, moving between English and Arabic in the same sentence, and to write Islamic and Arabic terms in Arabic script instead of in rough English spellings.

Speech recognition is a form of AI, so the listening in this tool is done by an AI speech model. Everything that happens to the words afterwards is done by fixed rules that we wrote, with no AI involved, as we explain below.

The parts we used

The heart of the tool is whisper.cpp, an open project that runs Whisper speech recognition models efficiently on ordinary computers. We use it with a Whisper model called large-v3-turbo, in a compressed form known as q5_0, which keeps the model small enough to run quickly on an ordinary computer.

The model runs on the computer’s graphics chip through Vulkan, a standard way for programs to use the graphics hardware. Graphics chips are built to do many calculations at once, which suits speech models well, and it leaves the main processor free for whatever else you are doing.

Before any audio reaches the model, a small voice filter called Silero listens for when someone is actually speaking. It means the model is not asked to make sense of silence or background noise, which saves time and avoids stray words appearing when nobody has spoken.

The rest of the tool is written in Python. A small floating light on the screen shows what the tool is doing, whether it is ready, listening, writing or done, so you always know whether it has heard you. A simple history page runs on the computer only, so you can find something you dictated earlier, and nothing in it is built to send that history anywhere.

Cleaning up the words without AI

A speech model gives back a stream of words, and that stream usually needs some tidying before it is ready to use. Punctuation, capital letters, spacing and the spelling of names all need attention.

We decided early on to do this clean-up with fixed rules and not with a second AI model. Rules are predictable, because the same input always gives the same output, and they never invent words that were not spoken. An AI model asked to tidy text can be very capable, but it can also change the meaning without any warning, adding a phrase here or dropping one there, and for a dictation tool we judged that risk not worth taking.

Part of the clean-up is a word fixer, which corrects names and Arabic terms that a speech model often gets wrong. A general model may hear an Arabic word and write the nearest English-sounding guess, so the word fixer looks for those guesses and puts the right word back, in Arabic script where that is how the word should be written. In our test of name fixing, the number of names put right rose from 26 to 68, and the number put wrong fell from 40 to 2.

Quran phrases, only on a strong match

People who speak about their faith will often recite part of an ayah in the middle of a sentence. A speech model will make its best attempt at the words, but its attempt may not match the Quran exactly, and we would never want our tool to type an approximation of the Quran and present it as the real text.

So the tool compares what it heard against the Quran text from Tanzil, an established open source of the text. Only when there is a strong match does it use the text from Tanzil. When the match is weak, it leaves the words as they were heard and does not pretend to know which ayah was meant. The tool never writes Quran text of its own, and the text it uses always comes from the source.

This is the same principle we follow in our recitation app, where the AI helps to find a place in a trusted text and every word shown is copied from the source. We explain that approach in more detail in our article on on-device AI for Quran recitation. As we say below, the Quran matching in the dictation tool has not yet been proven on a live microphone.

How we measure it

The number people notice most is the wait between finishing speaking and seeing the words appear. In our measurements, the median wait after releasing the key was 2.7 seconds, meaning half of all waits were shorter than that. One wait in ten was longer than 5.3 seconds, and the slowest single wait we recorded was 125 seconds, which shows there is still work to do on the worst cases.

We also tested how the tool behaves when the computer is busy, using one laptop and a recording of 73 seconds. With nothing else running, the recording was turned into text in 17.8 seconds. With every processor core kept busy by other work, it took 96.5 seconds. When we gave the dictation tool high priority on the same busy laptop, it took 48.3 seconds. A busy computer clearly slows it down, and raising its priority helps a good deal.

Behind these numbers sit 282 automated tests, which all pass. The tool is made of 50 Python files, with 5,268 lines of code in the main application and 15 files of tests. Tests cannot prove that a tool is free of faults, but they do mean that every change we make is checked against everything that already works.

What is not proven yet

No one outside our own work has checked the tool yet, so what this article describes is how it is built, and the privacy of it rests on that design rather than on any outside test.

The tool listens for the double tap on Ctrl through a keyboard hook, and we have not yet ruled out that the hook may miss a key press when the computer is under heavy load. That is an open item on our list, and we have not yet checked it.

Three features have not been seen working on a live microphone. The first is live words, which show what the tool is hearing while you speak. The second is the warning that appears when the microphone seems to be silent, which depends on a threshold we have not yet confirmed with real use. The third is the Quran matching described above. Each of these has been built and tested in other ways, but we will not call them proven until they have been seen working with a real microphone.

The tool is one of the pieces of software we have built for our own work, and it is not available to download at present. If that changes, it will appear on our software page, with these three open items either settled or still listed beside it.