<code>Sub VR_Result (Success As Boolean, Texts As List)
If Success = True Then
Dim advice As String
advice = Texts.Get(0)
Select advice
Case "advice one"
TTS1.Speak("love your enemies. Be kind to those who hate you and pray for your persecutors.",True)
Case "advice two"
TTS1.Speak("Focus your thoughts on the many wonderful blessings that God has bestowed upon you ",True)
Case Else
Return
End Select
End If
End Sub
</code>
Sub Pronuncia(Testo As String)
mTTS_Pronto = False
InitTTS
Do Until mTTS_Pronto
DoEvents
Loop
mTTSFinished = False
gTTS.Speak(Testo, True)
End Sub
Sub InitTTS
If gTTS.IsInitialized = False Then
gTTS.Initialize("gTTS")
Else
mTTS_Pronto = True
End If
End Sub
Where:
Sub Pronuncia = Sub Say or Speak
mTTS_Pronto = mTTS_Ready - global module variable
gTTS = Process Global variable
Hi Beja,
two elements to check:
1. log(Success) just to be sure it is True otherwise the whole TTS block will be skipped
2. log(advice) so to see what the engine recognized
Anyway, since you are checking against lowercase strings you should modify advice accordingly.
Umberto ,
Thanks and as you pointed, the problem is with the "advice!! I don't why or how.. but I worked around it by eliminating the For-Next loop
altogether and used different logic.
Umberto ,
Thanks and as you pointed, the problem is with the "advice!! I don't why or how.. but I worked around it by eliminating the For-Next loop
altogether and used different logic.
LM,
The meaning was SELECT - END SELECT...
I told you I am getting old but you don't believe me.
In 1987 I visited Italy.. I stayed the whole night in the train station of Roma because I couldn't afford to pay 100,000 a night in a hotel!!!
The next day morning I was shopping for shoes and the displayed prices were astronomical.. so I changed my mind.
I took the train to Perugia, a small university town in the heights of Northern Italy.. so beautiful. I stayed in Ostelo (Youth Hostel).