New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

js-speech-rekognition

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-speech-rekognition

### Usage

latest
npmnpm
Version
0.0.22
Version published
Maintainers
1
Created
Source

HTLM5 based speech recognition

Usage

Usage:

import {Rekognition} from 'js-speech-rekognition';

const r = new Rekognition();
r.setParams({
  lang: 'en-US',
  interimResults: false,
  continuous: false,
  matchThreshold: 0.8,
  grammar: [{
    phrase_id: 1,
    phrase: 'hello',
    aliases: ['hi there', 'wassup']
  },{
    phrase_id: 2,
    phrase: 'green',
    aliases: ['color']
  }, {
    phrase_id: 3,
    phrase: 'blue',
    aliases: ['color']
  }, {
    phrase_id: 4,
    phrase: 'red',
    aliases: ['color']
  }, {
    phrase_id: 5,
    phrase: 'yellow',
    aliases: ['color']
  }]
});

To enable debugging call:

r.debugOn();

To disable debugging call:

r.debugOff();

The service supports for the following custom events:

  • match - When the spoken command matches with the phrases in the grammar
  • error - When there's an error with the SpeechAPI
  • start - When speech rekognition service starts
  • stop - When speech rekognition service stops
  • partial_speech - When partial speech is detected
  • complete_speech - When final speech results are received

Attach event listeners as follow:

  r.on('match', e => {
    // do something
  });
  r.on('error', e => {
    // error occured
  });

To start the recognition service:

r.startRekognition();

To stop the recognition service:

r.stopRekognition();

To remove all listeners:

  r.removeListeners();

To reset all commands:

r.reset();

Keywords

speech

FAQs

Package last updated on 27 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts