Maintained by Oleksandr Lebedyev
Enhance your web applications with voice recognition and synthesis capabilities using this easy-to-integrate SDK.
- Voice Recognition: Convert spoken language into text.
- Voice Synthesis: Generate spoken audio from text.
- Minimal Setup: Quick integration into any web application.
For quick front-end projects, you can install using Bower:
bower install --save js-speech-sdk
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');
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'
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;
-
Offline Tests:
npm run test-offline
-
Integration Tests:
npm run test-integration
(Requires service credentials in.env
)
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.
For issues, feature requests, or contributions, please submit a pull request or open an issue in the GitHub repository.