GoogleCloudPlatform / node-red-contrib-google-cloud

Node-RED nodes for Google Cloud Platform
Apache License 2.0
90 stars 57 forks source link

languageCode on speech-to-text.js #29

Closed bernardoluciano closed 4 years ago

bernardoluciano commented 4 years ago

Could the language parameter be left as setting or out of code for Google Recognition to try to identify the language by itself? As it is in the repository code with "languageCode": "en-US", recogntion only works for en-US!

Here's the highlighted code part (speech-to-text.js line 53): const config = { "encoding": encoding, "sampleRateHertz": sampleRateHertz, "languageCode": "en-US" }

kolban-google commented 4 years ago

Howdy my friend. Apologies, I had failed to set up self notification. Looking at the issue now. Will post back as quickly as I can.

kolban-google commented 4 years ago

I think I have coded the change correctly. The Speech to Text node now has a configuration property that allows us to specify a language code. The default becomes en-US but can now be changed. For example, changing en-US to en-ES should now work. I haven't tested it with a language other than English so if I can ask ... would you test and report back if it works? Releases of this node set at 0.0.7 or greater will contain the change.

kolban-google commented 4 years ago

Based on @bernardoluciano thumbs up ... I'm going to assume it is working as of this point. Closing for just now. It can be re-opened as needed.