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

前端 未结 3 1908
广开言路
广开言路 2020-12-23 10:17

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 pl

相关标签:
3条回答
  • 2020-12-23 10:45

    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/

    0 讨论(0)
  • 2020-12-23 10:50

    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();
    
    0 讨论(0)
  • 2020-12-23 10:54

    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.

    0 讨论(0)
提交回复
热议问题