It seems that is exactly how TextToSpeech is designed. Guess that it can only load one language value at a time, and when you request another, it should download the current language data and load a new one. I added a problem here: https://code.google.com/p/android/issues/detail?id=200974
Google will probably fix this in the future. They did it!
As a workaround, now you can pre-synthesize the audio file and then just play it. FG, you can run some AsyncTask when starting Activity and generate sound in the background. And when it is ready, open the button in the user interface so that the user can play it. I also found that TextToSpeech is better to use its own service using the android: process attribute for the service, to avoid blocking the user interface on some devices when setLanguage loads language data.
UPDATE 2016-02-17: I just updated TextToSpeech to version 3.8.14 from February 15th. And no more delays! I use 2 languages ββthat read different language texts one by one and do not linger between them! Thanks to the Google team and TextToSpeech! You are the best!
UPDATE 2016-02-18: I tested more devices and found that the problem still exists for older devices where Android 4.x is still in use. Tested on XOOM with Android 4.1.2 and some unavailable device 7100 with Android 4.1.1. Both still have the same delays. Not sure if this is related, but I noticed that both Android devices with Android 4.x have a problem with UtteranceProgressListener. To make it work on such devices, I had to pass the utteranceId parameter to the talk () function. However, the device in which this error disappeared does an excellent job with this parameter. The device where it works fine now is LG d405 with Android 5.0.2. And it had the same latency problem before I installed the latest TextToSpeech update.
source share