Kitt-AI / snowboy

Future versions with model training module will be maintained through a forked version here: https://github.com/seasalt-ai/snowboy
Other
3.1k stars 999 forks source link

NodeJS example for write speech in wav after hotword detection #298

Open sintetico82 opened 7 years ago

sintetico82 commented 7 years ago

Hi, I am now about nodejs programming. I saw this example https://github.com/Kitt-AI/snowboy/blob/master/examples/Node/microphone.js with NodeJs and all work good. I want record audio in wav file after hotword detection but i don't understand how i can do that.

In the example there is this comment:

// <buffer> contains the last chunk of the audio that triggers the "hotword" // event. It could be written to a wav stream. You will have to use it // together with the <buffer> in the "sound" event if you want to get audio // data after the hotword.

But how?

chenguoguo commented 7 years ago

See here: https://github.com/Kitt-AI/snowboy/issues/1

sintetico82 commented 7 years ago

I saw, but it's little bit complicated. Can you provide an example using _hotword_and sound event?