iOS Question TTS isSpeaking ?

Branko Milosevic

Active Member
Licensed User
You can handle the Complete event:
B4X:
TTS.Speak(...)
Wait For TTS_Complete(Text As String)
'continue here

Or:
B4X:
If no.GetField("speaking") = True Then

Cannot use TTS_Complete because the I have added UtteranceDelay which rises TTS_Complete event after every utterance in the queue.

(Line 165) no.GetField("speaking") produced this error:

B4X:
Application_Start
Application_Active
tick
Error occurred on line: 165 (CurrentSession)
[<__NSCFConstantString 0x37c297a8> valueForUndefinedKey:]:
this class is not key value coding-compliant for the key speaking.
Stack Trace: (
  CoreFoundation       <redacted> + 152
  libobjc.A.dylib      objc_exception_throw + 38
  CoreFoundation       <redacted> + 0
  Foundation           <redacted> + 258
  Foundation           <redacted> + 234
  Impromtu Hoops       -[B4INativeObject GetField:] + 124
  CoreFoundation       <redacted> + 68
  CoreFoundation       <redacted> + 300
  Impromtu Hoops       +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1784
  Impromtu Hoops       -[B4IShell runMethod:] + 590
Impromtu Hoops       -[B4IShell raiseEventImpl:method:args::] + 2024
Impromtu Hoops       -[B4IShellBI raiseEvent:event:params:] + 1578
Impromtu Hoops       __24-[B4ITimer startTicking]_block_invoke + 290
libdispatch.dylib    <redacted> + 22
libdispatch.dylib    <redacted> + 384
libdispatch.dylib    <redacted> + 166
libdispatch.dylib    <redacted> + 794
libdispatch.dylib    _dispatch_main_queue_callback_4CF + 596
CoreFoundation       <redacted> + 8
CoreFoundation       <redacted> + 848
CoreFoundation       CFRunLoopRunSpecific + 470
 
Upvote 0

Branko Milosevic

Active Member
Licensed User
Sorry it's working, haha, somebody must have changed my code. However the
no.GetField("speaking") is a String type and I am using it as Boolean so there is a warning about that.
it's <B4i......:0> or <B4i......:1>
 
Upvote 0
Top