Android Question Voice Recognition 'Didn't catch that.' Dialog

B9X Electronics

Member
Licensed User
Longtime User
Hi:

I am trying to use the VoiceRecognition feature to recognize speech on demand. It works fine until the 'Didn't catch that.' dialog appears. I even tried using the example that controls it via the Activity_Click event. I basically tried most all the examples in the forum to no avail.

I would like it so I can programmatically restart the voice recognition without any user screen intervention. Right now voice recognition is blocked until someone clicks somewhere on the app.

Any help would be greatly appreciated.

Thanks, Rob
 

zed

Well-Known Member
Licensed User
You are touching on a structural limitation of Android, and that is why all the examples in the B4A forum behave the same way: standard speech recognition (SpeechRecognizer) cannot be restarted automatically after a failure or a “No speech detected”, because Google requires user interaction to restart listening.
It's a continuous anti-eavesdropping protection imposed by Google.

You could restart automatically with a timer.
Even if Android blocks an immediate restart, you can restart it after a short delay (300–800 ms).

The most robust method would be to use a service with continuous listening.
Automatically restart the onError event and maintain background listening.
This is the technique used by voice assistants (Jarvis, etc.).
 
Upvote 0

B9X Electronics

Member
Licensed User
Longtime User
You are touching on a structural limitation of Android, and that is why all the examples in the B4A forum behave the same way: standard speech recognition (SpeechRecognizer) cannot be restarted automatically after a failure or a “No speech detected”, because Google requires user interaction to restart listening.
It's a continuous anti-eavesdropping protection imposed by Google.

You could restart automatically with a timer.
Even if Android blocks an immediate restart, you can restart it after a short delay (300–800 ms).

The most robust method would be to use a service with continuous listening.
Automatically restart the onError event and maintain background listening.
This is the technique used by voice assistants (Jarvis, etc.).
Hi Zed:

Thank you for your response. I just wanted to clarify that my goal is to interface amateur radios to my Chromebook. This way an amateur radio operator could request services, like emergency 911, using their radio. With the way it works now, that is not possible.

Thanks, Rob
 
Upvote 0

zed

Well-Known Member
Licensed User
You're touching on a very interesting topic… but also a very regulated one.
Amateur radio operators are not allowed to directly call emergency services like 911 or any other official number.
International regulations (ITU) stipulate that amateur radio frequencies cannot be used for public traffic.
Emergency calls via amateur radio must be made on amateur radio emergency frequencies, not on telephone networks.
An amateur radio operator can request help by radio, but cannot trigger an automatic 911 call.
So: technically feasible, but legally prohibited.
 
Upvote 0

B9X Electronics

Member
Licensed User
Longtime User
You're touching on a very interesting topic… but also a very regulated one.
Amateur radio operators are not allowed to directly call emergency services like 911 or any other official number.
International regulations (ITU) stipulate that amateur radio frequencies cannot be used for public traffic.
Emergency calls via amateur radio must be made on amateur radio emergency frequencies, not on telephone networks.
An amateur radio operator can request help by radio, but cannot trigger an automatic 911 call.
So: technically feasible, but legally prohibited.
Hi Zed:

As far as I know, a licensed amateur radio operator CAN use autopatch, through a repeater, to call 911. Voice recognition would make telephone number entries that much easier.

BTW, I did try your original solution and it doesn't seem to work. Maybe I am not doing it correctly. I set up a timer to restart the VoiceRecognition object after 1500 milliseconds and the dialog still stays there.

Thank you for your help.

Thanks, Rob
 
Upvote 0
Top