DeepSpeech/examples/nodejs_wav
2019-10-17 08:53:38 +02:00
..
index.js Use model sample rate in examples 2019-10-10 22:04:33 +02:00
package.json Bump VERSION to 0.6.0-alpha.10 2019-10-17 08:53:38 +02:00
Readme.md Add a Nodejs wav file example 2019-03-03 18:58:27 -05:00
test.sh Run examples on TaskCluster 2019-09-17 20:19:09 +02:00

NodeJS voice recognition example using Mozilla DeepSpeech

Download the pre-trained model (1.8GB):

wget https://github.com/mozilla/DeepSpeech/releases/download/v0.4.1/deepspeech-0.4.1-models.tar.gz
tar xvfz deepspeech-0.4.1-models.tar.gz

Edit references to models path if necessary:

let modelPath = './models/output_graph.pbmm';
let alphabetPath = './models/alphabet.txt';
let lmPath = './models/lm.binary';
let triePath = './models/trie';

Install Sox (for .wav file loading):

brew install sox

Download test audio files:

wget https://github.com/mozilla/DeepSpeech/releases/download/v0.4.1/audio-0.4.1.tar.gz
tar xfvz audio-0.4.1.tar.gz

Install NPM dependencies:

npm install

Run:

node index.js

Result should be something like:

audio length 1.975
result: experience proves this

Try other wav files with an argument:

node index.js audio/2830-3980-0043.wav
node index.js audio/8455-210777-0068.wav
node index.js audio/4507-16021-0012.wav