Hello,
I am trying the TTS Library but get some error : in fact, when TTS is initialized, my example app crash with error
The unfiltered logs is below
My code is really simple and the project attached
Please could you point me to a way to fix this crash ? Many thanks
I am trying the TTS Library but get some error : in fact, when TTS is initialized, my example app crash with error
java.lang.RuntimeException: Error speaking text.
The unfiltered logs is below
LogCat connected to: B4A-Bridge: Acer V370-355338055629443
--------- beginning of /dev/log/main
create interp thread : stack size=32KB
create new thread
new thread created
update thread list
threadid=17: interp stack at 0x5d786000
threadid=17: created from interp
start new thread
threadid=17: notify debugger
threadid=17 (Thread-9052): calling run()
java.lang.RuntimeException: Error speaking text.
** Activity (main) Resume **
Setting install_non_market_apps has moved from android.provider.Settings.Secure to android.provider.Settings.Global.
invalidate [global]: current 249 != cached 248
from db cache, name = install_non_market_apps , value = 1
Failed to destroy process 25405
libcore.io.ErrnoException: kill failed: ESRCH (No such process)
at libcore.io.Posix.kill(Native Method)
at libcore.io.ForwardingOs.kill(ForwardingOs.java:81)
at java.lang.ProcessManager$ProcessImpl.destroy(ProcessManager.java:260)
at anywheresoftware.b4a.phone.Phone$LogCat.LogCatStop(Phone.java:759)
at anywheresoftware.b4a.b4abridge.service1._stoplogcat(service1.java:612)
at anywheresoftware.b4a.b4abridge.service1._streams_newdata(service1.java:673)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA$3.run(BA.java:307)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5299)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Failed to destroy process 25405
libcore.io.ErrnoException: kill failed: ESRCH (No such process)
at libcore.io.Posix.kill(Native Method)
at libcore.io.ForwardingOs.kill(ForwardingOs.java:81)
at java.lang.ProcessManager$ProcessImpl.destroy(ProcessManager.java:260)
at anywheresoftware.b4a.phone.Phone$LogCat.LogCatStop(Phone.java:759)
at anywheresoftware.b4a.phone.Phone$LogCat.LogCatStart(Phone.java:704)
at anywheresoftware.b4a.b4abridge.service1._startlogcat(service1.java:605)
at anywheresoftware.b4a.b4abridge.service1._streams_newdata(service1.java:669)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA$3.run(BA.java:307)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5299)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
threadid=17: exiting
threadid=17: bye!
create interp thread : stack size=32KB
create new thread
new thread created
update thread list
threadid=17: interp stack at 0x5d7e0000
threadid=17: created from interp
start new thread
threadid=17: notify debugger
threadid=17 (Thread-9053): calling run()
My code is really simple and the project attached
B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim TTS1 As TTS
Dim tTemp As String
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Button1 As Button
Dim Button2 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("1")
End Sub
Sub Activity_Resume
TTS1init
End Sub
Sub Activity_Pause (UserClosed As Boolean)
TTS1.Release
End Sub
Sub say(sentence As String)
sentence=sentence & " was pressed"
LogColor(sentence,Colors.Magenta)
If Not(TTS1.IsInitialized) Then
tTemp=sentence
TTS1init
Else
TTS1.Speak(sentence,True)
End If
End Sub
Sub TTS1init
If Not(TTS1.IsInitialized) Then
LogColor("TTS1init",Colors.green)
TTS1.Initialize("TTS1")
End If
End Sub
Sub TTS1_Ready (Success As Boolean)
LogColor("TTS1_Ready: "&Success,Colors.Green)
If Success Then
TTS1.Speak(tTemp,True)
Else
say(tTemp)
End If
End Sub
Sub Button2_Click
LogColor("button2",Colors.Red)
say("button 2")
End Sub
Sub Button1_Click
LogColor("button1",Colors.blue)
say("button 1")
End Sub
Please could you point me to a way to fix this crash ? Many thanks