How to stop speech recognition with a button on Android? - android

I currently use RecognizerIntent to perform STT on an Android app. When a user clicks a button, the Google Voice Input screen pops up, the user can speak and it is transcribed. When it is quiet enough, the popup shuts and the input is processed.
However, the popup will not shut / process the results if there is still some background noise (despite having transcribed the necessary words).
If I click the screen, the popup disappears, but the results are not processed.
Is there a way to click the popup window (the microphone that pops up) to force the app to stop recording and process the results it has already transcribed?
Thank you in advance!

Your question is not about the Android OS but about a particular end-user app that implements the RecognizerIntent activity.
Google app v10.98.7.21 on Android v10 does not seem to have this feature that you're after. However, there is no way of knowing for sure because it's a closed source app, without detailed release notes nor end user documentation, nor does it make any commitments regarding its future behavior. A good idea for your app is not to depend on such 3rd party apps.

Related

How to allow your phone to listen to you without pressing a button for Android?

I am able to have my app listen to the user (voice recognition) if they press a button. I would like to know how I can do the same thing without pressing a button, ie have the app perform a voice recognition task for certain key words.
Try using a Service, which is designed to run continuously in the background, and integrate listeners into it. Services, in general, are not affected by what what the user is doing with the visible UI.
http://developer.android.com/guide/components/services.html

Google Glass - replace in app context menu trigger 'ok glass' voice trigger with the actual top level menu selections as voice triggers instead

I've seen a couple of examples where on phone the voice recognizer is running as a background service - constantly listening and processing speech. I can't tell if implementing such services is restricted in the current GDK.
I'm prototyping a warehousing app and we'd like to use voice to pick from several top-level menu options without uttering 'ok glass' to invoke the initial menu context.
Anyone have a preferred example of this or know if/why it can't be done with the current GDK?
Thanks!
I now realize the naivety of the original question. I just ended up using the sdk speech recognizer and implemented the callbacks. To make the recognizer work continuously, I restart it on error or after it has delivered a set of results. I additionally added some state-indication UI to my activity that gives visual feedback to the user as the recognizer moves from listening to non-listening and back to listening states.

Speech API RecognizerIntent - Bypass the Didn't catch that. try speaking again message

I have implemented the RecognizerIntent and called google's voice recognition service and it works fine and i get results. However, sometimes if i mumble or am too far away from my device i get the message "Didn't catch that. Try speaking again." message. Is there a way to bypass this and not show this message as i don't want the users to have to press OK to continue?
Thanks
Use SpeechRecognizer if you want to be in control of the UI.
If I understand correctly then you are launching the RecognizerIntent and this gets handled by one of the activities in the Google Search app (or Google Voice Search, or whatever it happens to be called currently). Now, since this is an activity, it takes over the UI, i.e. it pops up a dialog box, shows a prompt and a VU meter, etc. In case of an error condition, it could in principle return control to your app by sending one of the error codes e.g. RESULT_NO_MATCH (as the documentation suggests), but it chooses not to. Instead it pops up a "try again" message. The only way to return to your activity is by pressing BACK, or hoping that the recognition succeeds.
If you want to control more of the user experience then use SpeechRecognizer. This way your are calling a service and then interact with it via callbacks. You will be in full control of the UI. Or almost, e.g. the Google app makes a beep when the recognition starts, and there is no way to turn it off and provide your own beep.
Note that this answer is specific (to a specific version) of Google's voice recognition service which is not part of Android proper. It implements part of the RecognizerIntent/SpeechRecognizer API but its different versions differ in the API coverage and their exact behavior. So this answer might become wrong in the future.

How to force my app to the front

I have developed an android app that uses a timer with a call back. When a specific criteria has been satisfied, the app either rings or vibrates the phone depending on user settings. It will continue to ring until the user acknowledges an alert box. This all works fine. However, if the user has brought another app to the front then he may not realize it is my app causing the phone to ring and re-open it. Is there a way I can force my App to the front or at least the Alert Message to be on top of anything else?
Notifications are your friend. They wont interrupt a users workflow and with the new JellyBean apis you can put actions and other dynamic components in them.
Instead of doing that, you could just use a notification with a specific ringtone once it has been sent instead of annoying the user this way.

Missing dedicated search button on devices

My app used to trigger a local search window when ever user tapped on dedicated search button on the device. Lately, all the devices that come out in the market stopped providing that button.
I know I can provide a search option in the app, but this question is not about that.
Is there a way user can still emulate the triggering of search on the app by some key press combinations?
Any suggestion will be helpful.
Thanks,
SKU
Pressing and holding the menu button usually brings up the search function on new android phones (e.g. SGS1 or SGS2)

Categories

Resources