Greetings everyone,
I'm trying to use tts.speak and I believe I'm not using it correctly.
Can you check my coding and let me know what I'm missing?
I originally thought it needed Talkback to be turned on but the app still crashes on the tts.speak statement with Talkback on and off.
Thanks in advance.
I'm trying to use tts.speak and I believe I'm not using it correctly.
Can you check my coding and let me know what I'm missing?
I originally thought it needed Talkback to be turned on but the app still crashes on the tts.speak statement with Talkback on and off.
Thanks in advance.
Error displayed in the logs::
b4xmainpage_setupacsformainpageviews (java line: 2796)
java.lang.RuntimeException: Error speaking text.
at anywheresoftware.b4a.obejcts.TTS.Speak(TTS.java:62)
at b4a.example.b4xmainpage._setupacsformainpageviews(b4xmainpage.java:2796)
at b4a.example.b4xmainpage._b4xpage_created(b4xmainpage.java:149)
at b4a.example.b4xmainpage.callSub(b4xmainpage.java:3732)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1066)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1037)
at b4a.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:526)
at b4a.example.b4xpagesmanager._showpage(b4xpagesmanager.java:863)
at b4a.example.b4xpagesmanager._addpage(b4xpagesmanager.java:203)
at b4a.example.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:210)
at b4a.example.b4xpagesmanager._initialize(b4xpagesmanager.java:714)
at b4a.example.main._activity_create(main.java:370)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at b4a.example.main.afterFirstLayout(main.java:105)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8633)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
--------- beginning of crash
*** Service (starter) Create ***
** Service (starter) Start **
** Service (servicemodule) Create **
** Service (servicemodule) Start **
tts declaration in Class_Globals::
Private tts As TTS
Initialising tts::
tts.Initialize("tts")
Statement that crashes the app::
tts.Speak("You are now on the app main screen.", False)