evancohen / sonus

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

Add different language support #10

Closed Pierre-Gilles closed 7 years ago

Pierre-Gilles commented 8 years ago

Hi !

I'm contacted you on Twitter last days, I'm the founder of Gladys.

I just finally tried your module with billing enabled on Google Cloud Plateform. It works like a charm :)

Just one feedback, as I'm speaking french, I want to send my voice to Google Cloud speech with the fr-FR languageCode.

We should be able to specify in your lib which language we are using. It's simple, just a little parameter to add :

    const recognitionStream = _self.recognizer.createRecognizeStream({
      config: {
        encoding: 'LINEAR16',
        sampleRate: 16000,
        languageCode: LANGUAGE_HERE
      },
      singleUtterance: true,
      interimResults: true,
      verbose: true
    })

Maybe it can be an optional parameter of the Sonus constructor.

It's just a detail, otherwise your module just works great :) Planning to make a blog post about that to my community.

If you want I can submit you a PR to add language support, or you can do it yourself, as you prefer.

Thanks again,

Pierre-Gilles commented 8 years ago

Another, non related feedback, when I install your module with a simple "npm install", post-install tasks of snowboy are not executed, and I don't get the compiled file of snowboy for my plateform ( and I get a missing file => /home/pi/node_modules/snowboy/lib/node/binding/Release/node-v48-linux-arm/snowboy.node )

But if I install manually snowboy after sonus, it just works.

Don't know if it's a problem on your side or on snowboy side :)

evancohen commented 8 years ago

I already implemented that last night in #8 (see the updated example for usage). I haven't updated the npm package yet, there are a few more things I want to do first, but I'm hoping to sort those out tonight. Let me know if there's anything I can do to help with your blog post!

Interesting issue with the installation, haven't seen that before. I'll investigate!

Keep the feedback coming!

evancohen commented 7 years ago

Closing this out because the language issue has been resolved and post-install seems to be working now.