Why speech recognition do not work?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Why speech recognition do not work?

Postby SmK74 » Tue Mar 10, 2015 3:33 am

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?
SmK74
Newbie
 
Posts: 4
Joined: Tue Mar 10, 2015 3:27 am

Re: Why speech recognition do not work?

Postby magreenblatt » Tue Mar 10, 2015 11:51 am

magreenblatt
Site Admin
 
Posts: 9365
Joined: Fri May 29, 2009 6:57 pm

Re: Why speech recognition do not work?

Postby SmK74 » Tue Mar 10, 2015 12:03 pm

But if use API keys - i got 50 requests limitation? Is it possible to avoid this?
SmK74
Newbie
 
Posts: 4
Joined: Tue Mar 10, 2015 3:27 am

Re: Why speech recognition do not work?

Postby magreenblatt » Tue Mar 10, 2015 12:20 pm

SmK74 wrote:But if use API keys - i got 50 requests limitation? Is it possible to avoid this?

No.
magreenblatt
Site Admin
 
Posts: 9365
Joined: Fri May 29, 2009 6:57 pm

Re: Why speech recognition do not work?

Postby SmK74 » Wed Mar 11, 2015 11:00 am

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?
SmK74
Newbie
 
Posts: 4
Joined: Tue Mar 10, 2015 3:27 am

Re: Why speech recognition do not work?

Postby SmK74 » Thu Mar 12, 2015 4:52 am

Forget to enable Speech API in google console... now all works
SmK74
Newbie
 
Posts: 4
Joined: Tue Mar 10, 2015 3:27 am

Re: Why speech recognition do not work?

Postby tgraupmann » Wed Feb 15, 2017 12:10 pm

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.
tgraupmann
Techie
 
Posts: 16
Joined: Tue Feb 14, 2017 12:51 pm

Re: Why speech recognition do not work?

Postby tgraupmann » Wed Feb 15, 2017 2:41 pm

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...
tgraupmann
Techie
 
Posts: 16
Joined: Tue Feb 14, 2017 12:51 pm

Re: Why speech recognition do not work?

Postby tgraupmann » Wed Feb 15, 2017 5:43 pm

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**
tgraupmann
Techie
 
Posts: 16
Joined: Tue Feb 14, 2017 12:51 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 26 guests