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

Fixes hang waiting for cancelled TextToSpeech #1895

Merged
merged 2 commits into from Jan 18, 2022

Conversation

borigas
Copy link
Contributor

@borigas borigas commented Oct 6, 2021

Description of Change

There's a bug in Android TTS that if you cancel quickly after starting TTS, SpeakAsync will never return. This is because the CancellationToken was cancelled before the TaskCompletionSource was being assigned, so awaiting the TaskCompletionSource would wait forever. To fix, I moved the creation of the TaskCompletionSource before we register with the CancellationToken

Bugs Fixed

Provide links to issues here. Ensure that a GitHub issue was created for your feature or bug fix before sending PR.

API Changes

None

Behavioral Changes

Describe any non-bug related behavioral changes that may change how users app behaves when upgrading to this version of the codebase.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Updated documentation (see walkthrough)

@borigas
Copy link
Contributor Author

borigas commented Oct 6, 2021

I don't think build failures were related to my changes. Let me know if I'm wrong

@jamesmontemagno jamesmontemagno added this to the 1.7.1 milestone Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Android TextToSpeech.SpeakAsync() hangs if cancelled immediately
3 participants