Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'error_no_match' does not get fired when user stops listening #509

Open
vongrad opened this issue Apr 14, 2024 · 3 comments
Open

'error_no_match' does not get fired when user stops listening #509

vongrad opened this issue Apr 14, 2024 · 3 comments
Labels
enhancement New feature or request to reproduce

Comments

@vongrad
Copy link
Contributor

vongrad commented Apr 14, 2024

I have noticed that error_no_match does not get fired after user stops listening because the flags isNotListening and _userEnded are set before calling the platform specific stop.

This happens in:

 Future<void> _onNotifyError(String errorJson) async {
    if (isNotListening && _userEnded) {
      return;
    }
    ...

The reason why this is an issue is that there is no consistent way to react to results - no matter if there is a match or not. For example, if the STT matches some text, the output looks like this:

/SpeechToTextPlugin( 7989): Notify status:notListening
D/SpeechToTextPlugin( 7989): Notify status:doneNoResult
D/SpeechToTextPlugin( 7989): rmsDB -2.0 / 10.0
D/SpeechToTextPlugin( 7989): rmsDB -2.0 / 10.0
D/SpeechToTextPlugin( 7989): Calling results callback

Note that Calling results callback is called after doneNoResult (perhaps the doneNoResult should be changed to done or similarly as this is a bit misleading when there are results, but its not an issue now).

Now consider the following output without any results:

D/SpeechToTextPlugin( 7989): Notify status:notListening
D/SpeechToTextPlugin( 7989): Notify status:doneNoResult

As you can see, its the same, but the Calling results callback is not called as there are no results.

Now to the issue, if you want, lets say show some popup to the user once the STT result is ready, independently if the STT matched something or not, there is no easy way to do it, as in case with the actual result, you would have to wait some amount of time to see if Calling results callback gets fired, because it could as well be the case where there is no result.

I would propose that the error_no_match get triggered even after the user stops listening as this way, we know the STT results are ready once Calling results callback gets fired OR error_no_match gets fired.

@sowens-csd
Copy link
Contributor

Interesting idea and a good explanation. Thanks for taking the time to write it up. Giving consistent feedback on results/no results seems like a very good thing to do.

I won’t be able to look at this for a few weeks but I’ll put it on the list.

@sowens-csd sowens-csd added enhancement New feature or request to reproduce labels Apr 14, 2024
@vongrad
Copy link
Contributor Author

vongrad commented Jul 12, 2024

@sowens-csd Any update on this issue?

@vongrad
Copy link
Contributor Author

vongrad commented Sep 10, 2024

@sowens-csd Did this ticket get lost?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request to reproduce
Projects
None yet
Development

No branches or pull requests

2 participants