I'm having some trouble. Sometimes it'll speak, other times it won't and won't give me an error message.
Activity com.omnicorp.lcarui.dialer.main has leaked ServiceConnection android.speech.tts.TextToSpeech$1@2b0b37b0 that was originally bound here
android.app.ServiceConnectionLeaked: Activity com.omnicorp.lcarui.dialer.main has leaked ServiceConnection android.speech.tts.TextToSpeech$1@2b0b37b0 that was originally bound here
at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:938)
at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:833)
at android.app.ContextImpl.bindService(ContextImpl.java:871)
at android.content.ContextWrapper.bindService(ContextWrapper.java:347)
at android.speech.tts.TextToSpeech.initTts(TextToSpeech.java:467)
at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:433)
at com.giuseppe.salvi.icos.library.TextToSpeech.TTs.InitializeTTs(TTs.java:118)
at com.omnicorp.lcarui.dialer.main._inittts(main.java:2979)
at com.omnicorp.lcarui.dialer.main._activity_resume(main.java:824)
Sub InitTTS(State As Boolean)
Log("INITTTS: " & State)
If State Then
If Not( TTS1.IsInitialized) OR Not(TTSisReady) Then TTS1.InitializeTTs("TTS1","en")' TTS1.Initialize("TTS1")
Else If TTS1.IsInitialized Then
TTS1.ShutDown
'TTS1.Release
TTSisReady=False
End If
End Sub
Sub Speak(Text As String)
Dim Error As Boolean
If TTS1.IsInitialized Then
Try
Log(SpeakName & " Say: " & Text)
If SpeakName Then
LCAR.Stop
TTS1.StopToSpeak
TTS1.Speaking(Text)
End If
Catch
Error=True
End Try
Else
Error=True
End If
If Error Then
Log("ERROR")
SpeakText=Text
InitTTS(True)
End If
End Sub
Sub StopSpeaking(Delay As Int)
If TTS1.IsInitialized Then
If Delay=0 Then
TTS1.StopToSpeak
Else
TTS1.PlaySilence(Delay)
End If
End If
End Sub
Sub TTS1_Ready (Success As Boolean)
TTSisReady=Success
If Success AND SpeakText.Length>0 Then Speak(SpeakText)
Log("TTS " & API.IIF(Success, "IS", "IS NOT") & " READY (" & SpeakText & ")")
SpeakText=""
End Sub