Skip to content

pmoskovi/speech-javascript-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IBM Watson Speech To Text Browser Client Library

Allows you to easily add voice recognition to any web app with minimal code.

Warning This is alpha software and will likely see major API changes. It doesn't even correspond to the proposed API currently.

See several examples at https://github.com/watson-developer-cloud/speech-javascript-sdk/tree/master/examples

This library is built with browserify browserify and easy to use in browserify-based projects (npm install --save watson-speech), but you can also grab the bundle from the dist/ folder and use it as a standalone library.

Check out https://www.npmjs.com/package/watson-developer-cloud to use Watson services from Node.js.

API

WatsonSpeechToText.stream({/*...*/}) -> Stream

Pass in a token (must be generated server-side) and any other desired options.

Returns a Node.js-style stream of the final text and also emits result events with full result data (including pre-final results, alternatives, word timing, confidence scores, etc.)

WatsonSpeechToText.promise({/*...*/}) -> Promise

Pass in a token (must be generated server-side) and any other desired options.

Returns a Promise that resolves to an Array of results. Pass that to .resultsToText() to get the final text as a string or do more complex processing on it yourself.

By default, interim_results is set to false (meaning that only final results will be included in the Array.)

Note: To use a promise with microphone input, either set continuous: false or call the .stop() method on the resulting promise (once the speech is complete). Otherwise the promise will not resolve in a timely manner (because it will continue to wait for more speech until the connection times out.)

WatsonSpeechToText.resultsToText(ArrayOfResults) -> Final Text

Helper method to turn .promise() results into a single string of text.

About

Library for using IBM Watson Speech to Text in browsers. NOT yet ready for production use.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%