Asked
— Edited
I have a problem using WaitForSpeech - I wonder if you could please advise DJ?
On my Win7 computer it does not work at all - there is no timeout the seconds variable gets ignored and the WaitForSpeech just runs through without a wait? I do see the timeout box very briefly. General SR works on this Win7 computer but I can only use it on US and not GB.
On my Win10 computer the same script works perfectly and the timeout window stays on the screen and counts down, so there is no problem here?
On the Win7 computer I then updated to the latest release (in case it was a previous bug) but this has made no difference.
Here is the script in question (which I borrowed from Rich)
:start
SayWait("What is 4 times 4")
$response = WaitForSpeech(10, "10", "12", "14", "16")
If($response = "16")
SayWait("Corect")
Goto(nextquestion)
Else
SayWait("sorry that is incorrect, please try again")
Goto(start)
EndIf
:nextquestion
Here is screendump of bottom of the Win7 screen.
Thanks for your help
Tony
Thanks guys for pointing this out, its so obvious now - I must have my dense head on today! I think its old age.
Attached is the simple project from the Win7 computer that gives/shows the WaitForSpeech issue. The issue does not occur on my Win10 computers with the same project.
Tony
speech.EZB
Tony, I get the same issue running your project on my Win7 laptop, haven't yet try it on Win10.
Chris.
I just tested in a windows 10 and i can reproduce the same issue.
Quick feedback (work call in 5 minutes)... i can't help debugging the ARC/SAPI calls.
SAPI API is not good with optional parameters... or guessing. I believe is a combination of how ARC initializes the SAPI recognizer and windows user settings.
@Tony If you have TeamViewer i can try later or tomorrow pls drop me an email.
Try the latest Release 2017.02.09.00
@DJ,
I tried Tony's project with a Windows 10 and is working now.
PS: Tony's away until next week.
Thanks a bunch @ptp. It may have been one of two things. The wait for speech window was many years old of code - so there may have been a cross thread exception with the timer counting down. tbe speech recognition engine didn't inherit the selected culture from the speech recognition module either, but I can't see that having an affect with the timer countdown. Leaning toward the possible cross threading exception. A label update wasn't invoked. Silly rookie mistake
It only popped its head under certain circumstances. Perhaps with certain cpus or architecture. Who knows how the Action factory in windows works behind the scene
I was going over Waitforspeech topic
I tried some old code from 2017, ToyMaker. I edited it so it would not keep asking - added a stop command, lol
Don't understand why he had a "nextquestion" in his code, so I commented that out also
:start SayWait("What is 4 times 4") $response = WaitForSpeech(10, "10", "12", "14", "16") if($response = "16")
SayWait("Corect, you got it right") Stop()
Goto(nextquestion)
Else SayWait("sorry that is incorrect, please try again") #Goto(start) endif #:nextquestion
works well
Wouldn't you need to keep that Goto(start) command to keep the script going until the right answer is given? It's commented out in your example.