Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Support for the webkitSpeechRecognition API in Opera

We're using the webkitSpeechRecognition API in Chrome. Since this is a prototype application, we're quite happy to support only Chrome, so we detect support for the API by doing a window.hasOwnProperty('webkitSpeechRecognition') check (as suggested by Google). This happily fails in Firefox, but the new Opera (being webkit-based) reports it does have the property. And, indeed, all code runs as intended, except... none of the events are ever fired, no voice is ever recorded.

So, my question is: can I make it work somehow? Does it require some special permissions or settings?

Alternatively, is there a way (aside good old browser-sniffing) to detect proper, working support for the webkitSpeechRecognition?

like image 470
SáT Avatar asked Apr 20 '16 10:04

SáT


People also ask

How does web Speech API work?

Web Speech API InterfacesRepresents error messages from the recognition service. The event object for the result and nomatch events, and contains all the data associated with an interim or final speech recognition result. The words or patterns of words that we want the recognition service to recognize.

What is speech recognition API?

The speech recognition part of the Web Speech API allows authorized Web applications to access the device's microphone and produces a transcript of the voice being recorded. This allows Web applications to use voice as one of the input & control method, similar to touch or keyboard.

How do I turn on speech recognition in Firefox?

speechRecognitionList. addFromString(grammar, 1); We then add the SpeechGrammarList to the speech recognition instance by setting it to the value of the SpeechRecognition grammars property.


2 Answers

Right now only google chrome have API to speech recognition by stream (they have google sppeech API).

If you will use https://www.google.com/intl/en/chrome/demos/speech.html on Opera it will tell you that you need Chrome25+ to do this.

Acording to http://caniuse.com/#feat=speech-recognition Opera webkit have support for this functionality but right now it is not working. Opera does not have any API service that would translate it on the fly. Right now there have only placeholders function in their browser, maybe in the future they will make it, right no it is not working.

* EDITED *

Example by google how to determinte if it working or not.

// checking by google
if (!('webkitSpeechRecognition' in window)) {
  console.log('GOOGLE: not working on this browser');
} else {
  console.log('GOOGLE: working');
}

//your way
if (window.hasOwnProperty('webkitSpeechRecognition')) {
  console.log('YOUR: working');
} else {
  console.log('YOUR: not working on this browser');
}
like image 126
Michał Ignaszewski Avatar answered Oct 20 '22 14:10

Michał Ignaszewski


The following Google sample uses a timestamp to detect that Opera did not trigger the start event: https://www.google.com/intl/en/chrome/demos/speech.html

like image 35
jlchereau Avatar answered Oct 20 '22 16:10

jlchereau