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="//"></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



Leave a Reply

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