简体   繁体   中英

Android Text To Speech TTS not bound to TTS engine after pressing home and back to apps

I use TTS with my phone and at the first app launch, tts is working well, but after I press the home button then go back again to my app and try to call event tts, its showing an error like this:

W/TextToSpeech: speak failed: not bound to TTS engine

I try to use this code

@Override
public void onInit(int status) {
    if (status == TextToSpeech.ERROR) {
        refresh();
    }
}

It will call the refresh function when TTS error occurs, but it is never called. I think its because of the apps already init for the first launch.

Maybe you should try to override onResume() method. Would you concider giving us piece of your code if it doesn't help?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM