Android Question TTS event

ivavilagu

Member
Licensed User
I have a problem with tts_ready event. This is the code

B4X:
Sub TTS1_Ready (Success As Boolean)
    If Success Then
        boolTTS = True
    End If
End Sub

boolTTS is a global variable that saves (obviously) the state of TTS. Here is the code for speaking text the first time:

B4X:
TTS1.Initialize("TTS1")
Do While boolTTS = False
Loop
TTS1.Speak(strlinea,True)

I use the Do/Loop event to ensure the TTS engine is ready before speaking the text. If I run the program step to step the execution works fine. If I run the program 'normally' it doesn´t work and hangs up.

I don´t want to put the tts1.speak line into tts1_ready event.
 

ivavilagu

Member
Licensed User
I reply myself. I have to insert the tts1.speak line into tts1_ready event, among other modifications at code in order to execute as well the program.
 
Upvote 0
Top