zagum/SpeechRecognitionView

onResults() callback is being called twice

gavingt opened this issue · 6 comments

Set a breakpoint here and you'll notice that the callback method is now being called twice:

This only started happening yesterday. I've confirmed that it happens on multiple devices.

Here's the only reference to this issue I can find online. It's a StackOverflow post from March, where this randomly started happening to them too:

https://stackoverflow.com/questions/60853257/android-recognitionlistener-onresults-being-called-twice

Hi, I'm not developer but just a user of this project. However, I would like to inform you that this issue is not related with SpeechRecognitionView. It is caused by Android Speech Recognition Service.

@yagizsenal Fair enough. Do you have any other information about it?

In regard of this issue, no. If you look for a solution, I have a hacky way for it. I managed the solve the issue by checking if any two results are the same and dismiss one result if they are.

I'm implemented a similar fix. The only minor issue is that I can sometimes hear the "beep" sound that accompanies the onResults callback play twice. Usually the beeps are right on top of one another, but sometimes the second lags behind the first and you hear both.

Here's the Issue Tracker link for this:
https://issuetracker.google.com/issues/152628934

Google is now on it.

zagum commented

@gavingt thanks for information