Skip to content

TalAter/annyang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

46d3f1c Β· Aug 13, 2022
Oct 1, 2019
Jan 12, 2021
Jan 12, 2021
Jan 12, 2021
Dec 2, 2020
Aug 9, 2022
Jan 3, 2016
Mar 10, 2019
Oct 26, 2016
Sep 10, 2016
Sep 29, 2016
Oct 1, 2018
Feb 19, 2019
Dec 6, 2019
Jan 12, 2021
Jun 13, 2020
Jun 8, 2019
Dec 6, 2019
Dec 6, 2019
Apr 29, 2017

Repository files navigation

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

Hello World

It's as easy as adding one javascript file to your document and defining the commands you want.

<script src="//cdnjs.cloudflare.com/ajax/libs/annyang/2.6.1/annyang.min.js"></script>
<script>
if (annyang) {
  // 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

<script src="//cdnjs.cloudflare.com/ajax/libs/annyang/2.6.1/annyang.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/SpeechKITT/0.3.0/speechkitt.min.js"></script>
<script>
if (annyang) {
  // Add our commands to annyang
  annyang.addCommands({
    'hello': function() { alert('Hello world!'); }
  });

  // Tell KITT to use annyang
  SpeechKITT.annyang();

  // Define a stylesheet for KITT to use
  SpeechKITT.setStylesheet('//cdnjs.cloudflare.com/ajax/libs/SpeechKITT/0.3.0/themes/flat.css');

  // Render KITT's interface
  SpeechKITT.vroom();
}
</script>

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

Author

Tal Ater: @TalAter

License

Licensed under MIT.