evancohen / sonus

:speech_balloon: /so.nus/ STT (speech to text) for Node with offline hotword detection
MIT License
625 stars 79 forks source link

Update index.js #32

Closed manzonif closed 7 years ago

manzonif commented 7 years ago

added the ability to set speechContext.

Added ability to set mic device, as in new release of node-record-lpcm16. Is useful for example using Matrix creator Mic array, passing param - 'device':'mic_channel8' see here

I hope this helps.

Thanks

evancohen commented 7 years ago

Excellent idea. At first glance this looks like it should work no problem. I'll test it tonight, merge, and cut a new version.

manzonif commented 7 years ago

Thanks Evans, I am only at an early stage of my project, and if I find new ideas, I will be happy to submit them.

Now I have to investigate on how it work stuff like azimutal angle and polar angle in the Matrix Creator Mic Array.

One thing I would like to ask you.

When I start my application, after few vocal commands, I start receive errors from this line:

csr.on('error', error => sonus.emit('error', { streamingError: error }))

The error is: { streamingError: Error: stream was destroyed at /home/pi/matrix-os/apps/test.matrix/node_modules/pump/index.js:45:21 at call (/home/pi/matrix-os/apps/test.matrix/node_modules/pump/index.js:50:3) at Array.forEach (native) at /home/pi/matrix-os/apps/test.matrix/node_modules/pump/index.js:72:16 at f (/home/pi/matrix-os/apps/test.matrix/node_modules/once/once.js:17:25) at /home/pi/matrix-os/apps/test.matrix/node_modules/pump/index.js:31:5 at f (/home/pi/matrix-os/apps/test.matrix/node_modules/once/once.js:17:25) at DestroyableTransform.onfinish (/home/pi/matrix-os/apps/test.matrix/node_modules/pump/node_modules/end-of-stream/index.js:30:18) at emitNone (events.js:91:20) at DestroyableTransform.emit (events.js:185:7) }

After error, application continue to run, but I would avoid it or at least understand it, and debug on raspberry it’s a really pain for me. I read something about Pump module, but I’m not sure I understood.

Have you ever had any experience of this?

Regards Fausto

From: Evan Cohen Sent: Friday, February 3, 2017 7:53 AM To: evancohen/sonus Cc: manzonif ; Author Subject: Re: [evancohen/sonus] Update index.js (#32)

Merged #32.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

evancohen commented 7 years ago

This is an issue with the google speech. I believe they fixed it recently, so you may want to try to install a newer version: https://github.com/jmuk/gcloud-node/commit/6a2ab348443e4d049ca26c638fa2f93defdba9b2

Luckily, it's actually pretty easy to debug node remotely on the pi: https://dzone.com/articles/remote-debugging-node-on-a-raspberry-pi