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

Is there a way to know when the tts package is finished speaking? #300

Closed
CodyBontecou opened this issue Jan 3, 2022 · 2 comments
Closed
Assignees
Labels
question Further information is requested

Comments

@CodyBontecou
Copy link

Is there an event that I can listen to that allows me to run code after my app is finished speaking?

@dlutton
Copy link
Owner

dlutton commented Jan 3, 2022

@CodyBontecou you can use await flutterTts.awaitSpeakCompletion(true); and then simply await your speak method. After your speak method is complete, then you know it's done. Another way is to use the callback

flutterTts.setCompletionHandler(() {
  setState(() {
    ttsState = TtsState.stopped;
  });
});

@dlutton dlutton self-assigned this Jan 3, 2022
@dlutton dlutton added the question Further information is requested label Jan 3, 2022
@CodyBontecou
Copy link
Author

Perfect, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants