I'm trying to make use of the SpeechRecognition interface of the Web Speech API. It works fine in the desktop version of Chrome but I can't get it to detect any audio in the Android version. After failing to get my own code to work I tested this demo as well as this other demo on two different Android devices (one running LineageOS Nougat, one running LineageOS Pie, both with Chrome 79) and neither demo worked on either device.
I'm not sure what's wrong here... can anyone else get these demos working on Android? I am serving my test page over https and I can record audio from the microhpone on these devices just fine using navigator.mediaDevices.getUserMedia so it doesn't seem to be a hardware, permission or security issue.
The specific symptoms I'm seeing are as follows:
Attempting to call
SpeechRecognition.stopseems to have no effect — the end event does not get fired. Calling
SpeechRecognition.startafter a stop attempt throws Uncaught DOMException: Failed to execute 'start' on 'SpeechRecognition': recognition has already started.
SpeechRecognition.abortdoes fire the
endevent and allows the recognition to be restarted.
Here's some test code based on the example from MDN.
Any ideas as to what the problem could be would be appreciated.