Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rxtoolkit/stt-deepspeech
👂 RxJS operator for speech-to-text using DeepSpeech
https://github.com/rxtoolkit/stt-deepspeech
fp functional-programming observables package reactive-programming rxjs speech-to-text stt transcription
Last synced: 5 days ago
JSON representation
👂 RxJS operator for speech-to-text using DeepSpeech
- Host: GitHub
- URL: https://github.com/rxtoolkit/stt-deepspeech
- Owner: rxtoolkit
- License: mit
- Created: 2021-02-09T19:33:25.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-16T18:39:26.000Z (11 months ago)
- Last Synced: 2024-11-09T17:36:21.542Z (2 months ago)
- Topics: fp, functional-programming, observables, package, reactive-programming, rxjs, speech-to-text, stt, transcription
- Language: JavaScript
- Homepage:
- Size: 3.45 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# @rxtk/toDeepSpeech
> 👂 An RxJS operator for real-time speech-to-text (STT/S2T) streaming using the opensource DeepSpeech library.```bash
npm i @rxtk/stt-deepspeech
``````bash
yarn add @rxtk/stt-deepspeech
```⚠️ To run the DeepSpeech pipeline, you must [download the corresponding DeepSpeech model](https://github.com/mozilla/DeepSpeech/releases), unzip it and pass the model directory to the `toDeepSpeech` operator like this: `toDeepSpeech({modelDir: 'path/to/deepseech-models-0.7.0'})`.
> ⚠️ node.js only. This has not been tested on Browsers but it might be possible to make it work. If you get it working, please make a PR!
## API
### `toDeepSpeech`
Stream audio speech data to DeepSpeech and get transcripts back:
```js
import {map} from 'rxjs/operators';
import {toDeepSpeech} from '@rxtk/stt-deepspeech';// The pipeline takes a stream of audio chunks encoded as LINEAR16 (PCM encoded as 16-bit integers) (Buffer, String, Blob or Typed Array)
const buffer$ = pcmChunkEncodedAs16BitIntegers$.pipe(
map(chunk => Buffer.from(chunk, 'base64')),
toDeepSpeech({modelDir: '/path/to/deepspeech-models-0.7.0'})
);
buffer$.subscribe(console.log); // log transcript output
```> ⚠️ Pay attention to the endcoding of the audio data. The operator only accepts PCM data encoded as 16-bit integers. For example, LINEAR16 encoding usually works.
## Guides
- [Introduction to audio data](https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Audio_concepts)