Annyang, an open-source JavaScript library by Tal Ater, reached version 3.0.0, a full rewrite in TypeScript that adds voice commands to any website. It weighs about 2 KB, has no dependencies, and needs no API keys, because it sits on top of the Web Speech API, the speech recognition engine already built into the browser. Setting up a command takes a few lines: you map a spoken phrase to a function, then call start(). Phrases can include wildcards, so search for *term passes whatever the user says after “search for” to your code. Version 3 ships type definitions, works as an import, a require(), or a plain <script> tag, and stays safe to call in browsers that lack speech recognition.
Adding voice to a website normally means wiring up a paid cloud service like Google Cloud Speech-to-Text or Amazon Transcribe, which costs money and takes setup. Annyang skips that by using the recognition the browser already provides, so the feature is free and lands in about five lines of code. For accessibility this matters: someone who cannot use a mouse can move through a site by speaking. It also fits kiosks, dashboards, and hands-free forms, where touching a screen is awkward.
The catch is what annyang inherits from the browser. Speech recognition only runs where the Web Speech API is implemented, mainly Google Chrome and Samsung Internet, and Chrome sends the audio to the cloud to transcribe it, so it is neither offline nor fully private. The real limit now is browser support and privacy, not the library.
Read More: annyang understands speech for free in the browser; VoxCPM2 handles the other direction, generating it.
Sources:
- annyang 3.0.0 changelog (GitHub)
- annyang live demos and tutorial
- annyang on npm
- Web Speech API (MDN)
- Speech Recognition browser support (Can I use)
Disclaimer: For information only. Accuracy or completeness not guaranteed. Illegal use prohibited. Not professional advice or solicitation. Read more: /terms-of-service
Reuse
Citation
@misc{kabui2026,
author = {{Kabui, Charles}},
title = {Annyang 3.0: {Add} {Voice} {Commands} to {Any} {Website}
{With} 2 {KB} of {JavaScript}},
date = {2026-06-17},
url = {https://toknow.ai/posts/annyang-2kb-javascript-voice-commands-web-speech-api/},
langid = {en-GB}
}
