@rxtk/stt-ibm

0.0.0Β β€’Β PublicΒ β€’Β Published

@rxtk/stt-ibm

πŸ‘‚ An RxJS operator for real-time speech-to-text (STT/S2T) streaming using the IBM Watson.

yarn add @rxtk/stt-ibm

You'll need an IBM Watson account with credentials for the STT API.

Demo

To run the demo pipeline:

yarn demo:run <myInstanceId> --secret <secretAccessKey> --write-output

API

toIBM

import {from} from 'rxjs';
import {myFunction} from '@rxtk/stt-ibm';
import {fromFile} from '@rxtk/fs';

const filePath = 'path/to/audio-file.linear16';
// For a full list of options, see ./src/lib/toIBM.js
const params = {
  secretAccessKey: process.env.IBM_SECRET_ACCESS_KEY,
  instanceId: process.env.IBM_STT_INSTANCE_ID,
  region: 'us-east',
};
const audioChunk$ = fromFile(filePath);
const output$ = string$.pipe(toIBM(params));
output$.subscribe(console.log); 
// Output:
// {...resultFromIBMWatson}
// {...anotherResultFromIBMWatson}
output$.error$.subscribe(console.error); // optional: handle Websocket Errors

References

Readme

Keywords

none

Package Sidebar

Install

npm i @rxtk/stt-ibm

Weekly Downloads

2

Version

0.0.0

License

MIT

Unpacked Size

26.3 kB

Total Files

14

Last publish

Collaborators

  • bfla