evancohen / sonus

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

Sonus not working on v7.9.0 #58

Closed sharmmoh1983 closed 6 years ago

sharmmoh1983 commented 6 years ago

Hi I am getting following error while running sonus: ERROR (Input():snowboy-io.cc:315) Fail to open input file "node_modules/snowboy/resources/common.res" terminate called after throwing an instance of 'std::runtime_error' what(): ERROR (Input():snowboy-io.cc:315) Fail to open input file "node_modules/snowboy/resources/common.res"

Even though binaries are fixed in v7.x as per you comment in older issue reported 29

sharmmoh1983 commented 6 years ago

I have updated node to v6.9.1. Still getting same runtime error

sharmmoh1983 commented 6 years ago

Just one idea... why we are looking for common.res from snowboy in sonus.js

We can have it from sonus resources folder to do away with such kind of error

sharmmoh1983 commented 6 years ago

I tried the above approach and it is working

evancohen commented 6 years ago

I didn't want to have people downloading the same file twice, but your mitigation is probably a good idea. I'll patch that this week.

sharmmoh1983 commented 6 years ago

Can I call register command on Sonus.annayang directly without using addCommands function

ex: Sonus.annayang.registerCommand

sharmmoh1983 commented 6 years ago

Can your build expose registerCommand Function as I need to call this function directly without using add Commands on annayang

evancohen commented 6 years ago

It looks like snowboy/resources/common.res still exists so I'm not sure why you're seeing this error. The "official" way that you could fix this without modifying the library is to pass in the "actual" path to common.res as a part of your sonus config. For example:

const sonus = Sonus.init({ hotwords,  resource: 'some/path/to/common.res'}, speech)

Implementation is here: index.js#L83

evancohen commented 6 years ago

As for exposing registerCommand, can you file another issue so it can be tracked separately? Please include what you're trying to accomplish, as there may be another way that's currently supported :)