npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

watson-html5-speech-recognition

v0.6.6

Published

Watson HTML5 Speech to Text

Downloads

19

Readme

watson-html5-speech-recognition

A Library to provide speech recognition capability in browsers.

Support

The library enables speech recognition support for any browser that includes support for either:

If the browser does not support either of the above, then currently you're out of luck.

watson-html5-speech-recognition use Web Speech API when present and Watson Speech To Text service for all other (supported) cases.

Currently, the following are supported:

  • Webkit speech recognition
    • Chrome (33)
    • FireFox (>=44)
  • Watson Speech to Text
    • Microsoft Edge
    • Firefox (<44)
    • Opera

Prequisites

  1. An instance of Watson Speech To Text Service (requires a Bluemix account)
  2. Watson Speech to Text Websocket server (provided. see Example section below)

Install

npm install watson-html5-speech-recognition

Usage

var Speech = require('watson-html5-speech-recognition');
var speech = new Speech.SpeechToText();

speech.listen({
    onStart: function() {
        console.log('starting');
    },
    onResult: function(e) {
        console.log(e.text);
    },
    onError: function(e) {
        console.log('error', e);
    },
    onEnd: function(e) {
        console.log('end', e);
    }
});

Customized Usage

If Watson speech services are engaged, the watson-html5-speech-recognition request a token from the server then communicates via websocket.

By default, watson-html5-speech-recognition assumes the token endpoint exists at /api/speech-to-text/token. If you alter the location of that endpoint, you must supply the new location via a configuration parameter upon instantiation. Like so...

var Speech = require('watson-html5-speech-recognition');
var speech = new Speech.SpeechToText({
  watsonTokenUrl: `/path/to/my/speech-to-text/token`
});

NOTE: The example server uses the watson-developer-cloud npm package to configure the token endpoint (see example/server/stt-token.js).

Example

The example contains a simple web front end, along with a backend web socket server that communicates with the Watson Speech To Text service

Setup the example

Clone the example:

git clone https://github.com/cdimascio/watson-html5-speech-recognition

Navigate to the example root:

cd example/server

Install dependencies:

npm install

Build the example:

npm compile

Run the example:

First, be sure to complete all steps in the section above, "Setup the example"

Then,

Open stt-token.js to line 10

Set '<your-username>' and '<your-username>' to match your Watson Speech To Text Service credentials.

npm start

Try it:

License

Apache 2.0