B Branko Milosevic Active Member Licensed User Jun 7, 2017 #1 How can I inquire this variable from AVSpeechSynthesizer B4X: var isSpeaking: Bool { get } Here is link to documentation: https://developer.apple.com/documentation/avfoundation/avspeechsynthesizer/1619680-isspeaking I tried this but no: B4X: Dim no AsNativeObject = TTS1 if no.RunMethod("isSpeaking:", Null) = true then log("speaking")
How can I inquire this variable from AVSpeechSynthesizer B4X: var isSpeaking: Bool { get } Here is link to documentation: https://developer.apple.com/documentation/avfoundation/avspeechsynthesizer/1619680-isspeaking I tried this but no: B4X: Dim no AsNativeObject = TTS1 if no.RunMethod("isSpeaking:", Null) = true then log("speaking")
Erel B4X founder Staff member Licensed User Longtime User Jun 8, 2017 #2 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 Upvote 0
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
B Branko Milosevic Active Member Licensed User Jun 9, 2017 #3 Erel said: 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 Click to expand... 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
Erel said: 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 Click to expand... 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
B Branko Milosevic Active Member Licensed User Jun 9, 2017 #4 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
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>
Erel B4X founder Staff member Licensed User Longtime User Jun 9, 2017 #5 Change it to no.GetField("speaking").AsBoolean Upvote 0