Raddy The Brand Official Website

annyang! Speech Recognition with JavaScript Tutorial

By Raddy in JavaScript ·

Annyang is a tiny javascript library that lets your visitors control your site with voice commands. annyang supports multiple languages, has no dependencies, weighs just 2kb and is free to use.

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <script src="//cdnjs.cloudflare.com/ajax/libs/annyang/2.6.0/annyang.min.js"></script>

        var messages = ['šŸ”Š Hey', 'šŸ”Š Hi, there!', 'šŸ”Š Hi!', 'šŸ”Š Hello'];

            console.log("We have annyang!");

            var commands = {
                'Hello' : hello,
                'What is your name' : myname

            function hello(){
                var randomIndex = Math.round(Math.random() * messages.length);
                console.log(`%c ${messages[randomIndex]}`,'color: green; font-weight:bold;');

            function myname(){
                console.log("My name is Billy!");

            // Add Commands

            // Start listening


  1. Adebayo says:

    I’ve tried to run bellow annoyang code on my system but not working. it displays noting.

    if (annyang) {
    Alert (‘annyang is working’);

    1. Raddy says:

      That’s strange. Try it in any Chromium browser and see if that works.

    2. jordan says:

      prueba lo con el console.log() a mi si me funciona correctamente

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.