xldaedalus
Member
I'm a newbie to java / android / B4A
Writing an app using Biswajit's Speech to Text. That part works great. Once I have created action with the text, I want the app to speak the result so user knows what the app is actually doing. The speaking is done by creating a JavaObject and the speaking works great using the voice engines on the phone. However on completion, of speaking is where the crash occurs, so I'm not doing something right. Here's the problem code. Line 14 appears to be the first sign of trouble, and the STT.startListening doesn't / can't start. Below code is unfiltered log. I assume a "frame" is something like a system clock counter? So, I don't know was skipped frames are. I added and removed TRY - CATCH to catch exceptions, but there or not, makes no difference.
Any ideas, suggestions would be greatly appreciated.
Start Speaking
Skipped 93 frames! The application may be doing too much work on its main thread.
Davey! duration=1572ms; Flags=0, FrameTimelineVsyncId=2821073, IntendedVsync=1167105536958399, Vsync=1167107090707074, InputEventId=0, HandleInputStart=1167107100661864, AnimationStart=1167107100666969, PerformTraversalsStart=1167107100670041, DrawStart=1167107101106187, FrameDeadline=1167105553625065, FrameInterval=1167107098855614, FrameStartTime=16706975, SyncQueued=1167107101774677, SyncStart=1167107102330198, IssueDrawCommandsStart=1167107102572802, SwapBuffers=1167107105736760, FrameCompleted=1167107110042750, DequeueBufferDuration=40938, QueueBufferDuration=2910990, GpuCompleted=1167107107814052, SwapBuffersCompleted=1167107110042750, DisplayPresentTime=0, CommandSubmissionCompleted=1167107105736760,
Start Speaking after sleep
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Done Speaking
Timer Enabled
UpdateGrammarFst():recognizer.cc:287) ["hey", "joe", "jill", "yo", "set", "channel", "value", "of", "oh", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety", "hundred", "percent", "intensity", "saturation", "cct", "kelvin", "fixture", "query", "on", "off", "all", "up", "down", "degrees", "point", "type"]
Estimate():language_model.cc:142) Estimating language model with ngram-order=2, discount=0.5
OutputToFst():language_model.cc:209) Created language model with 54 states and 106 arcs.
Unexpected event (missing RaiseSynchronousEvents): stt_readytolisten
Check the unfiltered logs for the full stack trace.
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1615)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:314)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at com.biswajit.vosk.SpeechToText.prepareMicrophone(SpeechToText.java:116)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:205)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.shell.DebugResumableSub$RemoteResumableSub.resume(DebugResumableSub.java:22)
at anywheresoftware.b4a.keywords.Common$14.run(Common.java:1748)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7920)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942)
microphone prepared
Speak_Now failed...
Speak_Now Catch(Exception) Not initialized
STT ready
STT Failed to Start...
Unable to match the desired swap behavior.
Expecting binder but got null!
Skipped 36 frames! The application may be doing too much work on its main thread.
Skipped 62 frames! The application may be doing too much work on its main thread.
Davey! duration=1056ms; Flags=0, FrameTimelineVsyncId=2823206, IntendedVsync=1167165030295356, Vsync=1167166063628648, InputEventId=0, HandleInputStart=1167166077388925, AnimationStart=1167166077396790, PerformTraversalsStart=1167166077403613, DrawStart=1167166077914602, FrameDeadline=1167165046962022, FrameInterval=1167166076824759, FrameStartTime=16666666, SyncQueued=1167166079759186, SyncStart=1167166080399186, IssueDrawCommandsStart=1167166080802988, SwapBuffers=1167166083309134, FrameCompleted=1167166087738509, DequeueBufferDuration=64375, QueueBufferDuration=952552, GpuCompleted=1167166087738509, SwapBuffersCompleted=1167166085466373, DisplayPresentTime=1167107139784208, CommandSubmissionCompleted=1167166083309134,
Skipped 36 frames! The application may be doing too much work on its main thread.
Skipped 40 frames! The application may be doing too much work on its main thread.
Skipped 153 frames! The application may be doing too much work on its main thread.
Writing an app using Biswajit's Speech to Text. That part works great. Once I have created action with the text, I want the app to speak the result so user knows what the app is actually doing. The speaking is done by creating a JavaObject and the speaking works great using the voice engines on the phone. However on completion, of speaking is where the crash occurs, so I'm not doing something right. Here's the problem code. Line 14 appears to be the first sign of trouble, and the STT.startListening doesn't / can't start. Below code is unfiltered log. I assume a "frame" is something like a system clock counter? So, I don't know was skipped frames are. I added and removed TRY - CATCH to catch exceptions, but there or not, makes no difference.
Any ideas, suggestions would be greatly appreciated.
B4X:
Sub speak_now( cTxt As String )
If cTxt.Length>0 Then
Try
Log("Start Speaking")
tts.Speak(cTxt, True )
Dim jo As JavaObject = tts
Log("Start Speaking after sleep")
Do While jo.RunMethod("isSpeaking",Null)
Sleep(250)
Log("Speaking")
Loop
'
Log("Done Speaking")
timer.Enabled=True
Log("Timer Enabled")
STT.prepareMicrophone(jsontext)
Log("microphone prepared")
'' STT.prepareMicrophone("")
If STT.startListening(-1) Then
Log("Speak_Now failed...")
Else
Log("TTS re-started...")
End If
Catch
Log("Speak_Now Catch" & LastException)
End Try
End If
End Sub
Start Speaking
Skipped 93 frames! The application may be doing too much work on its main thread.
Davey! duration=1572ms; Flags=0, FrameTimelineVsyncId=2821073, IntendedVsync=1167105536958399, Vsync=1167107090707074, InputEventId=0, HandleInputStart=1167107100661864, AnimationStart=1167107100666969, PerformTraversalsStart=1167107100670041, DrawStart=1167107101106187, FrameDeadline=1167105553625065, FrameInterval=1167107098855614, FrameStartTime=16706975, SyncQueued=1167107101774677, SyncStart=1167107102330198, IssueDrawCommandsStart=1167107102572802, SwapBuffers=1167107105736760, FrameCompleted=1167107110042750, DequeueBufferDuration=40938, QueueBufferDuration=2910990, GpuCompleted=1167107107814052, SwapBuffersCompleted=1167107110042750, DisplayPresentTime=0, CommandSubmissionCompleted=1167107105736760,
Start Speaking after sleep
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Speaking
Done Speaking
Timer Enabled
UpdateGrammarFst():recognizer.cc:287) ["hey", "joe", "jill", "yo", "set", "channel", "value", "of", "oh", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety", "hundred", "percent", "intensity", "saturation", "cct", "kelvin", "fixture", "query", "on", "off", "all", "up", "down", "degrees", "point", "type"]
Estimate():language_model.cc:142) Estimating language model with ngram-order=2, discount=0.5
OutputToFst():language_model.cc:209) Created language model with 54 states and 106 arcs.
Unexpected event (missing RaiseSynchronousEvents): stt_readytolisten
Check the unfiltered logs for the full stack trace.
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1615)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:314)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at com.biswajit.vosk.SpeechToText.prepareMicrophone(SpeechToText.java:116)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:205)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.shell.DebugResumableSub$RemoteResumableSub.resume(DebugResumableSub.java:22)
at anywheresoftware.b4a.keywords.Common$14.run(Common.java:1748)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7920)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942)
microphone prepared
Speak_Now failed...
Speak_Now Catch(Exception) Not initialized
STT ready
STT Failed to Start...
Unable to match the desired swap behavior.
Expecting binder but got null!
Skipped 36 frames! The application may be doing too much work on its main thread.
Skipped 62 frames! The application may be doing too much work on its main thread.
Davey! duration=1056ms; Flags=0, FrameTimelineVsyncId=2823206, IntendedVsync=1167165030295356, Vsync=1167166063628648, InputEventId=0, HandleInputStart=1167166077388925, AnimationStart=1167166077396790, PerformTraversalsStart=1167166077403613, DrawStart=1167166077914602, FrameDeadline=1167165046962022, FrameInterval=1167166076824759, FrameStartTime=16666666, SyncQueued=1167166079759186, SyncStart=1167166080399186, IssueDrawCommandsStart=1167166080802988, SwapBuffers=1167166083309134, FrameCompleted=1167166087738509, DequeueBufferDuration=64375, QueueBufferDuration=952552, GpuCompleted=1167166087738509, SwapBuffersCompleted=1167166085466373, DisplayPresentTime=1167107139784208, CommandSubmissionCompleted=1167166083309134,
Skipped 36 frames! The application may be doing too much work on its main thread.
Skipped 40 frames! The application may be doing too much work on its main thread.
Skipped 153 frames! The application may be doing too much work on its main thread.