-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Node module for snowboy #52
Conversation
Thanks a lot for the hard work guys! I'll take a closer look tomorrow. |
looks good to me! I had to additionally do |
That might be worth including in the docs, but it's not a direct dependency of the module since you can pipe any arbitrary audio data (provided it's the correct format). |
I'll mention that in the docs. Will have to look into the pull request tomorrow, was working on some other stuff :-) |
I took a look at all the changed files, look good! I was thinking of squashing those commits into one, but on another thought, this contribution comes from two different developers, so let's keep those commits!
If things look good to you, I'm ready to merge! Thanks a million for the fantastic work @evancohen and @nekuz0r |
@chenguoguo @evancohen for me, commits can be squashed :) |
Thanks @nekuz0r ! I'll leave this to @evancohen . If we end up with squashing the commits, make sure you put @nekuz0r and @evancohen in the message so people know who contributed this commit :-) |
@chenguoguo I have the script sitting on my Pi at home, I can dig it up tonight. I'm also fine squashing the commits (or I can rebase on my side and squash everything into ~7 commits that make sense, instead of the 30 that we have). Is that email address associated with an account on the npm site? I'm having trouble adding it as a collaborator. I did one final sanity check (evancohen@e7d5472) incriminating the version number to Everything looks green on my end! There's one open question from @Mexxxo on evancohen#1 about how we name the event handlers... |
@evancohen yes please rebase and squash if that's not too much trouble for you. Squashing to 7 sounds good! Sorry about the email, please try again, the user name is kitt.ai. For the VAD we have in Snowboy, it's more like silence v.s. non-silence. |
I've rebased my branch and squashed both of our commits into larger changes, hopefully that's ok with @nekuz0r. @chenguoguo I've added that email as a collaborator to the npm package. As for VAD, if it's actually "non-silence" then Edit: Also, it looks like you enabled builds for pull requests which leaves you vulnerable to someone hijacking the binary (If someone made a PR with |
@evancohen thanks, looks very clean now! Let's go with Good catch on the PR trigger! I turned it off. |
My auto-publish script for the pi: All set 🚀 |
I updated @evancohen what extra steps does it take to publish the node module to npmjs.com? I've never done this by myself. |
@chenguoguo |
That should do it. I would recommend publishing the binaries for 1.1.0 first if you haven't already. |
I did a test publish with 1.0.11 and everything seems to be working. I'll bump it to 1.1.0 tomorrow after publishing the binaries (don't have a Raspberry Pi by hand now). |
Could this be tweaked to work in browser ? |
@lynxaegon Not easily, since all the node module does is wrap a compiled library for some platform. Theoretically, it might be possible in the future for the kitt.ai team to compile the snowboy library for something like asm.js, but that part of the detection is closed source as of now. |
Ok, so i'm stuck with a python detector + a long poll request to detect a hotword. |
On the other hand, nothing's stopping you from running the node.js code on your server & streaming browser audio to it. Looks like that's what you're already doing with Python, though |
@arilotter beat me on this, indeed you can stream your browser audio capture to a node server via websocket and get the detected keyword back via the same channel :) |
Is there anyway to import this into an electron project? I get this error:
...when |
@nick-jonas yup! It's for Sonus, but it'd be easy to adapt to use just for snowboy: https://github.com/evancohen/sonus-electron-boilerplate |
@evancohen that's great! I get the same error though :(
|
@nick-jonas So you ran through the install steps in the README and the boilerplate didn't work? It's possible that I inadvertently broke it when trying to fix something for ARM evancohen/sonus-electron-boilerplate@3a5bd4e. If that's the case then you can check out the parent commit before that change and |
Changing this in package.json did the trick (from ^1.4):
|
What version do you have installed now? |
@nick-jonas looks like you didn't install |
ahh right that was it, thanks @evancohen |
https://gist.github.com/Wqrld/a34ee45c8cf8edefad58eae5e33cdd7a it seems like the prebuilt files are inaccessible and compiling also doesnt work on ubuntu 16.04 Intel Edit because i dont want to email everyone again: make sure to download the correct cblas lib, there are multiple on apt but only one of them works, i believe its the dev one |
@Wqrld Your build seems to failed because the lib cblas can't be found on your system, install it and try again. |
Authors
Info
This PR adds an npm package that uses
node-gyp
withNan
to create a JavaScript interface between the prebuilt snowboy native hotword detection and the Node runtime.Using
node-pre-gyp
, we are able to host pre-compiled versions of the native addon for OSX, Linux x64, and the Raspberry Pi (arm), which makes using the package super easy!More info: #4
Installation of this package uses a platform independent command:
Usage
There are two examples provided in this PR for streaming from a file and directly from a microphone. The short version of this is:
Requirements
Before accepting this PR, there are a few things that need to be taken care of. Pre-building the Nan extension is great so people don't have to compile on their own, but it requires some configuring on the snowboy end of things if you want it to continue to work:
[publish binary]
or[republish binary]
(see examples in my commit history) will publish/republish the native binary for the version specified inpackage.json
.🚀