voice-cmdr

0.1.0 • Public • Published

voiceCmdr

voiceCmdr is a library for adding voice commands to your website. It is build on top of Webkit Speach API.

Browser support

  • Google Chrome 31+

Getting started

Check examples directory. You need to access your website through http or https protocol. Thus, you need to host your website on some server (can be localhost).

API

  • Add command:

      voiceCmdr.addCommand("command", callbackFunction);
    

    Example:

      voiceCmdr.addCommand("home", function () {
      	// navigate to home page
      });
      
      voiceCmdr.addCommand("search", function (param) {
      	console.log("Searching for:", param);
      });	
    
  • Remove command:

      voiceCmdr.removeCommand("command");
    
  • Start listening (continuously):

      voiceCmdr.start();
    
  • Stop listening:

      voiceCmdr.stop();
    
  • Get single command:

      voiceCmdr.getCommand();
    
  • Turn debug mode on/off:

      voiceCmdr.debug(true|false);
    

LICENSE

MIT

Package Sidebar

Install

npm i voice-cmdr

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • jj09