flutter_tts
flutter_tts copied to clipboard
W/TextToSpeech(11619): speak failed: not bound to TTS engine
🐛 Bug Report
I occasionally get this error
W/TextToSpeech(11619): speak failed: not bound to TTS engine
It's not very common, but when I get it I find I have to restart my entire app to get text-to-speech working again.
Just wondering if I am doing something incorrectly - otherwise perhaps there is a way I can detect this in code and restart the TTS engine (without having to restart the whole app) or something?
Many thanks for any help, and for this amazing lib! :)
Possibly related:
- https://github.com/dlutton/flutter_tts/issues/11
- https://github.com/dlutton/flutter_tts/issues/29
- https://github.com/dlutton/flutter_tts/issues/36
Reproduction steps
Essentially (this more often than not works fine, but does fail once every so often):
flutterTts = FlutterTts();
await flutterTts.speak("my cool text");
Configuration
Version: 3.5.0
Platform:
- [ ] :iphone: iOS
- [x] :robot: Android
Just try to wait some time before calling speak, and you should be good. Use Future.delayed if convenient (might take around 500ms to initialize).
Thanks for the tip @chimura, will give this a go.