js-speech-sdk

1.0.6 • Public • Published

Speech Services for Web Browsers

Maintained by Oleksandr Lebedyev

Enhance your web applications with voice recognition and synthesis capabilities using this easy-to-integrate SDK.

Key Features

  • Voice Recognition: Convert spoken language into text.
  • Voice Synthesis: Generate spoken audio from text.
  • Minimal Setup: Quick integration into any web application.

Installation

Using Bower

For quick front-end projects, you can install using Bower:

bower install --save js-speech-sdk

Using NPM with Browserify or Webpack

For more complex projects that use module bundlers like Browserify or Webpack:

npm install --save js-speech-sdk

This installation method allows for importing only needed components to reduce bundle size:

var recognizeMic = require('js-speech-sdk/speech-to-text/recognize-microphone');

Configuration

Using with IAM Authentication

To use with IAM-authenticated services, a server-side component is required to securely retrieve the token. Set up the TEXT_TO_SPEECH_IAM_APIKEY and SPEECH_TO_TEXT_IAM_APIKEY in your environment:

TEXT_TO_SPEECH_IAM_APIKEY='your-key-here'
SPEECH_TO_TEXT_IAM_APIKEY='your-key-here'

Angular Compatibility

Ensure polyfills.ts in your Angular project includes:

(window as any).global = window;
(window as any).process = require('process/browser');
import 'zone.js/dist/zone';  // Included with Angular CLI.
global.Buffer = global.Buffer || require('buffer').Buffer;

Development and Contributions

Testing

  • Offline Tests: npm run test-offline
  • Integration Tests: npm run test-integration (Requires service credentials in .env)

Observing Transactions

While the W3C Websocket API limitations prevent direct retrieval of the X-Global-Transaction-Id, you can inspect this via the browser's Network tab during development.

Need Help?

For issues, feature requests, or contributions, please submit a pull request or open an issue in the GitHub repository.


Readme

Keywords

none

Package Sidebar

Install

npm i js-speech-sdk

Weekly Downloads

0

Version

1.0.6

License

none

Unpacked Size

88.5 kB

Total Files

28

Last publish

Collaborators

  • aresobus