Android Question [Solved] TTS engines. On some devices it works, on others it does not work.

vecino

Well-Known Member
Licensed User
Longtime User
Hello, I use a function so that the user listens to a series of important messages, so that he does not have to keep an eye on the screen to read them, and cannot be skipped.

The problem is that in some devices it works fine and in others it shows the exception:
(RuntimeException) java.lang.RuntimeException: Error speaking text.

What should I check in Android to make sure that everything is correct?
Thank you very much.

This is the code:
B4X:
Dim TTS1 As TTS
TTS1.Initialize("TTS1")


Sub Habla( cTxt As String )
    If cTxt.Length>0 Then
        Try
            TTS1.Speak(cTxt, True )    
            Dim jo As JavaObject = TTS1
            Do While jo.RunMethod("isSpeaking",Null)
                Sleep(250)
            Loop
        Catch
            Log(LastException)          
        End Try
    End If
End Sub
 
Last edited:

vecino

Well-Known Member
Licensed User
Longtime User
I have found the problem.
It is because they have no "TTS engine" enabled.
I have enabled one for them and it works on the devices that did not work before.
Thank you very much.
 
Upvote 0
Top