Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

annyang

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

annyang

A JavaScript library for adding voice commands to your site, using speech recognition

latest
Source
npmnpm
Version
3.0.0
Version published
Weekly downloads
4K
-19.12%
Maintainers
2
Weekly downloads
 
Created
Source

annyang!

A tiny JavaScript Speech Recognition library that lets your users control your site with voice commands.

annyang has no dependencies, weighs just 2 KB, and is free to use and modify under the MIT license.

Demo and Tutorial

Play with some live speech recognition demos

FAQ, Technical Documentation, and API Reference

Install

npm install annyang

Hello World

It's as easy as installing annyang and defining the commands you want.

import annyang from 'annyang';

if (annyang.isSpeechRecognitionSupported()) {
  // Let's define a command.
  const commands = {
    'hello': () => { alert('Hello world!'); },
    'search for *term': (term) => { console.log(`Searching for ${term}`); },
  };

  // Add our commands to annyang
  annyang.addCommands(commands);

  // Start listening.
  annyang.start();
}

Named imports

import { addCommands, start, isSpeechRecognitionSupported } from 'annyang';

if (isSpeechRecognitionSupported()) {
  addCommands({ 'hello': () => { alert('Hello world!'); } });
  start();
}

CommonJS

const annyang = require('annyang');

Script tag (IIFE)

<script src="dist/annyang.iife.min.js"></script>
<script>
if (annyang.isSpeechRecognitionSupported()) {
  // Let's define a command.
  const commands = {
    'hello': () => { alert('Hello world!'); }
  };

  // Add our commands to annyang
  annyang.addCommands(commands);

  // Start listening.
  annyang.start();
}
</script>

Check out some live speech recognition demos and advanced samples, then read the full API Docs.

Adding a GUI

You can easily add a GUI for the user to interact with Speech Recognition using Speech KITT.

Speech KITT makes it easy to add a graphical interface for the user to start or stop Speech Recognition and see its current status. KITT also provides clear visual hints to the user on how to interact with your site using their voice, providing instructions and sample commands.

Speech KITT is fully customizable and comes with many different themes, and instructions on how to create your own designs.

Speech Recognition GUI with Speech KITT

For help with setting up a GUI with KITT, check out the Speech KITT page.

Author

Tal Ater: @TalAter

License

Licensed under MIT.

Keywords

speech

FAQs

Package last updated on 11 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts