Skip to content

Voice control for your websites and applications

License

Notifications You must be signed in to change notification settings

coolandcodes/anycontrol

 
 

Repository files navigation

AnyControl

AnyControl is a small JavaScript SpeechRecognition library that lets your users control your site with voice commands. It is build on top of Webkit Speech API.

AnyControl has no dependencies, just 3 KB small, and is free to use and modify under the MIT license.

NPM

Issues Forks Stars License Package CodeOfConduct

Browser support

Google Chrome 31+

Getting started

<script src="https://unpkg.com/anycontrol/dist/index.umd.min.js"></script>
<script>
  var ctrl = new anycontrol()

  ctrl.addCommand("previous page", function() {
    console.log('Go to previous page')
  });

  ctrl.addCommand("next page", function () {
    console.log('Go to next page')
  });

  ctrl.start();
</script>

API

Add command

ctrl.addCommand("home", function() {
  // Navigate to home
});

ctrl.addCommand("search", function(param) {
  console.log("Search for:", param);
});

Remove command

ctrl.removeCommand("search");

Start listening (continuously)

ctrl.start();

Stop listening

ctrl.stop();

Get single command

ctrl.getCommand();

Turn debug mode on/off

ctrl.debug(true|false);

LICENSE

MIT

About

Voice control for your websites and applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%