Home » Html » How Google Voice Search works? Is there an API for that?

How Google Voice Search works? Is there an API for that?

Posted by: admin November 30, 2017 Leave a comment

Questions:

I’m not sure if this is the right site for this question, but I was wondering how the voice activated search on Google’s homepage works. Does it use Flash, some kind of plugin built into Google Chrome, or how does it use the microphone? This could be a dangerous privacy invasion if it is allowed to work the same way on any website, because no dialog asking for permission comes up, and I find this startling that Google (and who knows what other sites) can use my microphone without my permission. How is Google doing this? Javascript? Actionscript? Some custom plugin?

Answers:

It’s available to anyone. There’s more information here:

http://chrome.blogspot.com/2011/04/everybodys-talking-and-translating-with.html

and an example here:
http://www.web2voice.com/chrome-speech-input.html

I’m glad I’m not the only one who thinks the lack of a permissions prompt feels a little bit big-brother-esque.

Questions:
Answers:

It’s using HTML5 speech input via <input type="text" x-webkit-speech />

as the name suggests, this only works in webkit. Not sure if there are alternatives for other browsers.

See http://jsfiddle.net/xYB3n/

Questions:
Answers:

A nice wrapper for the Web Speech API is available here: talater.com/annyang.

This library allows you to easily bind functions to voice commands, eg:

annyang.init({
    "help": function() {$("#help").show();}
});
annyang.start();