DeepSpeech/native_client/javascript
2020-04-06 22:12:00 +02:00
..
binding.gyp Update Python, NodeJS and ElectronJS to latest stables 2020-01-13 16:17:13 +01:00
client.ts Package and expose TypeScript for JS interface 2020-04-06 11:15:42 +02:00
deepspeech.i Exposing ErrorCode API in Tree bindings (#2806) 2020-03-21 15:40:39 +01:00
index.d.ts Expose Stream-related within Stream class 2020-04-06 22:12:00 +02:00
index.js Exposing ErrorCode API in Tree bindings (#2806) 2020-03-21 15:40:39 +01:00
Makefile Package and expose TypeScript for JS interface 2020-04-06 11:15:42 +02:00
package.json.in Package and expose TypeScript for JS interface 2020-04-06 11:15:42 +02:00
README.md Update README 2020-04-03 13:28:56 +02:00
tsconfig.json Package and expose TypeScript for JS interface 2020-04-06 11:15:42 +02:00

Full project description and documentation on GitHub: https://github.com/mozilla/DeepSpeech.

Generating TypeScript Type Definitions

You can generate the TypeScript type declaration file using dts-gen. This requires a compiled/installed version of the DeepSpeech NodeJS client.

To generate a new index.d.ts type declaration file, run:

npm install -g dts-gen
dts-gen --module deepspeech --file index.d.ts

Example usage

/// index.ts
import DeepSpeech from "deepspeech";

let modelPath = '/path/to/model';
let model = new DeepSpeech.Model(modelPath);
model.setBeamWidth(1000);

let audioBuffer = ...;
model.sttWithMetadata(audioBuffer);

FreeModel(model);