Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

annyang

> 编程语言
Open source

Speech recognition for your site

6.8K stars0 likes1 views
WebsiteGitHub

About

Speech recognition for your site

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

  • annyang Frequently Asked Questions
  • annyang API reference
  • annyang tutorial
  • CHANGELOG

Install

bash
npm install annyang

Hello World

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

ESM (recommended)

javascript
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

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

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

CommonJS

javascript
const annyang = require('annyang');

Script tag (IIFE)

xml
<script src="https://cdn.jsdelivr.net/npm/annyang@3/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. For help with setting up a GUI with KITT, check out the Speech KITT page.

Author

Tal Ater: @TalAter

License

Licensed under MIT.

Issues· 10 open

View all issuesOpen on GitHub
  • #447

    Microsoft Edge adding dot to end of spoken word

    enhancementUpdated Mar 10, 2026
  • #456

    Immediately browser crash for MS Edge on Linux (Ubuntu)

    Updated Oct 20, 2023
  • #327

    Pass custom context to commands

    Updated Jan 31, 2022
  • #18

    Allow defining a command prefix

    enhancementUpdated Nov 17, 2021
  • #401

    Callback for Trigger method

    Updated Jul 23, 2019
  • #100

    Hotword Detection

    Updated Feb 9, 2018
  • #289

    addition of data types to command variables

    Updated Jun 7, 2017
  • #101

    Add support for capturing interimResults (Real Time Hypothosis)

    Updated Jan 24, 2017
  • #236

    Word Probability

    Updated Jan 16, 2017
  • #11

    Add support for SpeechGrammar

    enhancementUpdated Nov 6, 2015

> Tags

TypeScriptspeechspeech-recognitionspeech-to-textvoice

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 23, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言