Page 1 of 1

Why speech recognition do not work?

PostPosted: Tue Mar 10, 2015 3:33 am
by SmK74
Try to run cefclient.exe from cef_binary_3.2171.1979_windows64 - speech recognition doesn't work. You can reproduce it on main google page.
Google Chrome shows popup "Allow microphone" but CEF didn't. Is any way to fix it?

Re: Why speech recognition do not work?

PostPosted: Tue Mar 10, 2015 11:51 am
by magreenblatt

Re: Why speech recognition do not work?

PostPosted: Tue Mar 10, 2015 12:03 pm
by SmK74
But if use API keys - i got 50 requests limitation? Is it possible to avoid this?

Re: Why speech recognition do not work?

PostPosted: Tue Mar 10, 2015 12:20 pm
by magreenblatt
SmK74 wrote:But if use API keys - i got 50 requests limitation? Is it possible to avoid this?

No.

Re: Why speech recognition do not work?

PostPosted: Wed Mar 11, 2015 11:00 am
by SmK74
I have got API keys, create 3 environment variable (GOOGLE_API_KEY, GOOGLE_DEFAULT_CLIENT_ID and GOOGLE_DEFAULT_CLIENT_SECRET) for current user and run
cefclient with --enable-speech-input flag.
But i got an error:
Code: Select all
SpeechRecognitionError {message: "", error: "network", clipboardData: undefined, path: NodeList[0], cancelBubble: falseā€¦}

Exactly the same error if i don't provide api keys.
Code to reproduce:
Code: Select all
var recognition = new webkitSpeechRecognition();
  recognition.continuous = true;
  recognition.interimResults = true;
  recognition.onstart = function() { console.log("start"); }
  recognition.onresult = function(event) { console.log("result",event); }
  recognition.onerror = function(event) { console.log("error",event); }
  recognition.onend = function() { console.log("end"); }
  recognition.start();


Propably API keys should be activated? Or environment variables shouldn't be in upper case?

Re: Why speech recognition do not work?

PostPosted: Thu Mar 12, 2015 4:52 am
by SmK74
Forget to enable Speech API in google console... now all works

Re: Why speech recognition do not work?

PostPosted: Wed Feb 15, 2017 12:10 pm
by tgraupmann
SmK74 wrote:Forget to enable Speech API in google console... now all works


Which console? Because I'm in the same boat.

I followed the same steps.
http://www.chromium.org/developers/how-tos/api-keys

I have got API keys, create 3 environment variable (GOOGLE_API_KEY, GOOGLE_DEFAULT_CLIENT_ID and GOOGLE_DEFAULT_CLIENT_SECRET) for current user and run
cefclient with --enable-speech-input flag.

Did that, but it's still not hitting the cloud services. I don't even see a blip in analytics. I hit the Microphone button which blinks and never works.
https://www.google.com/intl/en/chrome/demos/speech.html

I tried setting environment vars as user vars and as system vars. No effect.

cefclient.exe --enable-speech-input

I even tried to set programatically.

Code: Select all
            System.Environment.SetEnvironmentVariable("GOOGLE_API_KEY", "...");
            System.Environment.SetEnvironmentVariable("GOOGLE_DEFAULT_CLIENT_ID", "...");
            System.Environment.SetEnvironmentVariable("GOOGLE_DEFAULT_CLIENT_SECRET", "...");
            using (var application = new DemoAppImpl())
            {
                return application.Run(new string[] {
                    "--enable-speech-input",
                });
            }


I used the Google developer console.
https://console.developers.google.com/

It should be active. I'm not sure what I missed...

Is there a way to pass the api keys on the command-line?

The docs mention a `args.gn` file.

I'd like to be able to set the api key at runtime.

Re: Why speech recognition do not work?

PostPosted: Wed Feb 15, 2017 2:41 pm
by tgraupmann
I just realized that Chome (the Browser) stopped working with the speech demo.
https://www.google.com/intl/en/chrome/demos/speech.html

So apparently Chrome uses the same environment vars.

It seems like it's a server configuration issue then...

Re: Why speech recognition do not work?

PostPosted: Wed Feb 15, 2017 5:43 pm
by tgraupmann
I found the issue. There are several Speech APIs. You need to search and activate the API that says...

"Speech API Private API The Speech API allows developers to access Google speech-recognition services. It is only available for development and personal use."

That and the API auth keys just stop working periodically throughout the day. **BETA**