Open dolanmiu opened 7 years ago
Did you try compiling it from our github repo? Or did you use the pre-compiled library for node?
I used the pre-compiled lib for node, I didn't do any compiling myself, only npm install
and npm did all the magic and hard work
Could you checkout our repository and try to compile it? See here: https://github.com/Kitt-AI/snowboy#compile-a-node-addon
It boots now, one problem after starting the program on the terminal it stops recording immediately.
It shows something like this : End Recording: 106.121ms
@bogdanabadi see here, https://github.com/Kitt-AI/snowboy/issues/176, probably your mic is not properly set up.
In that thread their microphone wasn't working, so running command like rec for them throws an error unlike me which records through the hdwebcam 3000. I have followed http://docs.kitt.ai/snowboy/#access-microphone guide and still not working and stops recording immediately.
Just to make things clear what I am trying to achieve, I am using MagicMirror2 that is basically electron with widgets and I want to integrate alexa as an extra module. When electron boots up it ask for the mic. Does that cause an error because electron requests the mic and snowboy via terminal or is it not relevant.
PS: On a Mac it works just fine. @dolanmiu
I'm also including @evancohen as he might have some insights
I found something interesting, the MagicMirro2 (Electron) occupying the mic and thus snowboy can't detect the mic. When disabling the mic request in electron, snowboy can access the mic and detect the hotword. Do you recommend releasing the mic from snowboy as soon as a hotword is detected and passing to electron, or send the audio file from snowboy without releasing the mic. Which is best practice ?
PS: Someone had an issue and somehow fixed it https://github.com/gillesdemey/node-record-lpcm16/issues/33. But how come it causes no issue on my mac ?
I see, ideally you would share the audio capturing for Snowboy and whatever other programs using audio.
I see, ideally you would share the audio capturing for Snowboy and whatever other programs using audio.
Do you mean do the recording in one place, and then pass the recorded .wav
file to places which need the recorded file?
Yes, but you don't necessarily have to save to the audio to the file. You can "route" the audio to either Snowboy or some other applications that are using the audio. Snowboy supports audio streaming, which means you can send the audio to Snowboy chunk by chunk.
When you try to install the precompiled snowboy module you're active runtime is ~arm
- but when you try to include it inside your electron project it looks for the electron-v1.6-linux-arm
binary (when only the arm
binary exists).
The best way to fix this would be to recompile for electron/ARM or to set the correct environmental variables before running npm install
. You may want to take a look at my sonus-electron-boilerplate as a starting point; The key in this case being .npmrc
.
@chenguoguo @evancohen Thank you for the reply.
But @evancohen can you elaborate a bit more ? So when you say only the arm
binary exists, what is it unable to do ? Share the mic between Snowboy and electron ?
Electron packages it's own versions of Node and V8, separate from what you have installed locally. When you are using a prebuilt binary within the electron runtime it looks for the binary associated with electron (in your case electron-v1.6-linux-arm
), not the binary that was installed when you ran npm install
, which is determined by the version of node that you have installed locally.
Here's the relevant Electron documentation: Using Native Node Modules
have you tried forking in the electron process and using process.env.ELECTRON_RUN_AS_NODE
@datapimp I'd never actually seen that, thanks for pointing it out! You can also use spawn('node', ...)
to crate a child process.
That said, neither of these options would work if you're trying to package and distribute your app, because that would require the end user to have the same version of node installed on their machine that you've got. I suppose you could also bundle binaries for every version of node out there right now, but that would break if they upgraded :/
Electron ships with node already, so when you do that it uses that node but doesn't provide any of the electron core modules to your runtime. You still need to bundle any dependencies and handle native deps, but nothing electron builder won't make painless
I get this error, it seems like it cannot build electron binaries:
I am using node
6.10.3
Raspian - Raspberry Pi 3@bogdan1133