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

Inconsistent status updates on Android compared to iOS #560

Open
0minKoh opened this issue Sep 23, 2024 · 2 comments
Open

Inconsistent status updates on Android compared to iOS #560

0minKoh opened this issue Sep 23, 2024 · 2 comments

Comments

@0minKoh
Copy link

0minKoh commented Sep 23, 2024

I encountered an issue where status updates behave inconsistently on Android compared to iOS using the example code provided on the official package page

Reproduction steps:

  1. I implemented the statusListener as follows to track and print the status changes:
void statusListener(String status) {
    print("status: $status");
    setState(() {
      lastStatus = status;
    });
  }
  1. Testing on an iOS device, the status changes work as expected and print clearly in the console:
flutter: status: listening
...
flutter: status: done
  1. However, when testing on an Android emulator, I observed an extra "notListening" status and duplicate "done" status in the output:
I/flutter (11189): status: listening
...
I/flutter (11189): status: notListening
I/flutter (11189): status: done
I/flutter (11189): result: SpeechRecognitionResult words: [SpeechRecognitionWords words: 네 물론이죠,  confidence: 0.8676231, SpeechRecognitionWords words: 네 물론이지요,  confidence: 0.89166784], final: true
I/flutter (11189): status: done

Expected behavior:

On Android, the status updates should behave similarly to iOS, where the sequence would be listening -> done without the extra notListening and duplicate done statuses.

Actual behavior:

On Android, the status output shows an unexpected notListening followed by two done statuses.
listening -> notListening -> done -> (ResultListener Executed) -> done

Additional Information:

Issue only observed on Android (tested on emulator: Pixel 7 Pro API 14 arm64-v8a, Android 14.0).
iOS status updates function as expected.
Please let me know if further details or logs are needed. Thank you for your assistance!

@sowens-csd
Copy link
Contributor

Thanks for the very detailed issue report, this is helpful. I agree that the behaviour should be the same and it sure sounds like the Android behaviour isn't correct. I'll investigate.

@sowens-csd
Copy link
Contributor

I haven't been able to reproduce this on a real device. I'm wondering if it is an artifact of the emulator. Can you reproduce?

I'm still not happy with the way that status updates are handled and am planning a revamp, partly to ensure that the done status is only sent after the last results are delivered but I'd like to know if duplicate status notifications are a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants