I ivavilagu Member Licensed User Longtime User Oct 27, 2013 #1 I have a problem with tts_ready event. This is the code Code: Copy 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: Code: Copy 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.
I have a problem with tts_ready event. This is the code Code: Copy 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: Code: Copy 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.
I ivavilagu Member Licensed User Longtime User Oct 27, 2013 #2 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
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.
Erel B4X founder Staff member Licensed User Longtime User Oct 27, 2013 #3 Such loops do not work. They block the main thread and prevents the event from being raised. You should remove this variable and continue your program flow from the Ready event. Upvote 0
Such loops do not work. They block the main thread and prevents the event from being raised. You should remove this variable and continue your program flow from the Ready event.