Hossein Shahdoost
Hossein Shahdoost

Reputation: 1742

TTS init lag after onInit()

I'm writing an application which uses GoogleTextToSpeech for French language, the problem is that after onInit when I use setLanguage to change the tts language to French the tts object won't work for like 10-15 seconds. I have tried other languages (English, Deutsch) and there is no such problem. I wanna know if there is anyway to know that the tts object has actually started for the selected language (after onInit)

Upvotes: 0

Views: 32

Answers (1)

Hossein Shahdoost
Hossein Shahdoost

Reputation: 1742

Well, Just found a solution to this problem hope it helps others as well. There is a method setOnUtteranceProgressListener(UtteranceProgressListener) which takes a listener and calls it for different events of TTS. so if you register your listener here, and also assign an utteranceId when calling speak method (See how to assign UtteranceId). OnStart method gets called when the tts has actually started to speak. so you can show a progress or whatever from the time you call speak method until when onStart has not been called.

Upvotes: 1

Related Questions