Closed imomin closed 8 years ago
Thanks for the suggestion. You probably should not start utterance every time you get data. So it should be something like
mic.startCapture();
decoder.startUtt();
mic.audioStream.on('data', function(data) {
decoder.processRaw(data, false, false);
console.log(decoder.hyp());
if (decoder.hyp() == "something") {
decoder.endUtt();
mic.stopCapture();
}
});
Ah... OK. Thanks!
For those who would like to use the audio directly from mic. They can use npm microphone. (NOTE: I was having issue installing Lame v1.0.2, therefore, I installed latest (v1.2.4) and copied the source)
Usage would look something like.