rleiman Well-Known Member Licensed User Longtime User Feb 19, 2022 #1 Greetings everyone, I'm writing a small sub routine to stay in a loop until tts has finished speaking based on Erel's coding from this post: Post to determine when tts finishes speaking I coded this sub routine using the coding from the post: Code: Copy Sub StayHereWhileTtsIsSpeaking Do While jo.RunMethod("isSpeaking",Null) = True Sleep(100) Loop Log("done speaking") End Sub The post didn't show what the declaration statement was for jo so I assumed this coding would work: Code: Copy Private jo As JavaObject The IDE gave me a warning that it needs to be initialised. When I ran the app, the logs told me I need to initialise jo. I looked at the dropdown after typing the dot for jo but I wasn't sure which one to use since it was not included in the post. Can you let me know what the initialise statement should look like? Thanks.
Greetings everyone, I'm writing a small sub routine to stay in a loop until tts has finished speaking based on Erel's coding from this post: Post to determine when tts finishes speaking I coded this sub routine using the coding from the post: Code: Copy Sub StayHereWhileTtsIsSpeaking Do While jo.RunMethod("isSpeaking",Null) = True Sleep(100) Loop Log("done speaking") End Sub The post didn't show what the declaration statement was for jo so I assumed this coding would work: Code: Copy Private jo As JavaObject The IDE gave me a warning that it needs to be initialised. When I ran the app, the logs told me I need to initialise jo. I looked at the dropdown after typing the dot for jo but I wasn't sure which one to use since it was not included in the post. Can you let me know what the initialise statement should look like? Thanks.
rleiman Well-Known Member Licensed User Longtime User Feb 19, 2022 #3 drgottjr said: Dim jo As JavaObject = tts Click to expand... You are the best! ? Code: Copy Sub StayHereWhileTtsIsSpeaking Dim jo As JavaObject = tts Do While jo.RunMethod("isSpeaking",Null) = True Sleep(100) Loop Log("done speaking") End Sub Upvote 0
drgottjr said: Dim jo As JavaObject = tts Click to expand... You are the best! ? Code: Copy Sub StayHereWhileTtsIsSpeaking Dim jo As JavaObject = tts Do While jo.RunMethod("isSpeaking",Null) = True Sleep(100) Loop Log("done speaking") End Sub