flutter_tts icon indicating copy to clipboard operation
flutter_tts copied to clipboard

W/TextToSpeech(11619): speak failed: not bound to TTS engine

Open asmith26 opened this issue 1 year ago • 2 comments

🐛 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

asmith26 avatar Jul 22 '22 20:07 asmith26

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).

chimura avatar Jul 23 '22 00:07 chimura

Thanks for the tip @chimura, will give this a go.

asmith26 avatar Jul 23 '22 14:07 asmith26