Does Chrome have built-in speech recognition for “x-webkit-speech” input elements?

后端 未结 10 2073
眼角桃花
眼角桃花 2020-12-08 05:09

I\'m wondering how


Is there a speech recognition enging built into Chrome or is it ac

相关标签:
10条回答
  • 2020-12-08 05:55

    Speech recognition is a proposal by Google. https://docs.google.com/View?id=dcfg79pz_5dhnp23f5

    The feature ships with Chrome 8+ and it looks like it sends the data to google servers to perform the actual recognition.

    0 讨论(0)
  • 2020-12-08 06:01

    Yes, Chrome does have built-in speech support through WebKit; just look at the Google homepage (which now has a microphone to the right of the search box). I wonder, however, if the Chrome team is working on Omnibox speech support. After all, Chrome is a WebKit-based browser!

    0 讨论(0)
  • 2020-12-08 06:06

    There is also a working group that produced http://www.w3.org/TR/xhtml+voice/ but I don't believe this is implemented in any browser except Opera.

    0 讨论(0)
  • 2020-12-08 06:12

    According to the code it sends the audio data as a POST request to:

    https://www.google.com/speech-api/v1/recognize?client=chromium&lang=??&lm=??&xhw=??&maxresults=3
    

    lm is grammar in the code, xhw is hardware_info which is optional according to a comment. The audio appears to be speex, x-speex-with-header-byte:

    // Encode the frame and place the size of the frame as the first byte. This
    // is the packet format for MIME type x-speex-with-header-byte.
    

    It looks like it would be pretty trivial to modify the chrome code to use in your own app.

    Update:

    You also need to get a speech recognition API key and they are limited to 50 requests per day. There is no way to increase that limit - not even by paying.

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