Currently i always use the internal google speech engine; the TTS engine is started from a starter service module. Yesterday i removed the libray tts id and switched back to the standard tts system and i saw, that some timing problems are gone.
When the user is choosing a new language i switch
with code like this:
If Starter.Speaker.SetLanguage(Ln1,Ln2)=False Then
Sleep(100)
Ok=False
For i1= 1 To 3 'try three more times
Ok= Starter.Speaker.SetLanguage(Ln1,Ln2)
Sleep(200)
If Ok =False Then
Log("problems setting the language: " & i1)
Else
SpeachEnabled=True
Exit
End If
Next
end if
Starter.Speaker.Speak("",True) 'new - does not speak, but pausing is now over!
As you can see, i do four attempts to get the languages switched.
So i use the boolean return value from Setlanguage to check, if the correct language is working.
Currently i fight with this problem:
~ 3% of the selectet language is incorrect, so a german speaker gets french language an so on. Maybe i can check with the java object, which language is currently set for speaking?