It is important to be able to use an HTML5/js api for speech recognition. For example, we have an app that successfully runs in modern chrome browsers using webkitSpeechRecognition. However, it will not run within a cordova webview giving the error that webkitSpeechRecognition is undefined.
As pointed out elsewhere, webkitSpeechRecognition is not supported currently in cordova webview:
Is webkitSpeechRecognition supported on Cordova?
The above question asks whether it is supported. It apparently is not. My question is how to get around this and get web api based speech recognition to work in Cordova - a widely important problem.
It is possible to do speech recognition in cordova using dedicated cordova plugins, like cordova-plugin-speechrecognition, phonegap-plugin-speech-recognition. However, these have a number of issues and have not ultimately proved suitable. For example, they provide different support and performance by device, even within the same os. Also, they behave in ways that don't suit our use case, eg speech recording ends when the recognizer algo decides that speech is 'over', which can be problematic for pauses, and we haven't been able to figure out how to suppress this.
See also: Android Continuous SpeechRecognition: Preventing End
Another approach is to record audio to a file, convert the file to an appropriate format, submit the file via webAPI to one of the speech recognition services (eg google cloud speech) and get the results back. This approach is both complicated involving a number of steps, and slow. It is not well-suited to applications that need results in near real time, like for a conversation.
Is it possible to load an alternative webview that would include webkitSpeechRecognition? Crosswalk used to provide functionality for this purpose in the past.
Is there some more recent version, or beta, of cordova (for either android or ios or ideally for both) that supports webkitSpeechRecognition? Alternatively, is there some other web api for speech recognition that is supported by cordova that will accomplish a similar result?
Bottom line: how can this be achieved?
Thanks