Community Question

If I use a say command in a script, the speech recognition control stops recognizing anything. Once the say command completes, the speech recognition control starts picking up recognizing what is said again. I don't think that this used to work this way but maybe it did. I used to pause the speech recognition when using the say command when needed, but it looks like this is now a built in "feature". Unfortunately it causes someone not to be able to cancel the speech that is being said by the say command through SpeakStop( ) without using a keyboard or mouse or some other input or sensor. You can't say "Cancel" for example while a long say statement is running.

DJ, am I missing something or is this intended?

Here is an example...

Script named something like "SayAIResponse"

Code:


say( "This is a long sentence that goes on and on. It might be the news or weather or an RSS feed of some sort. While I am saying this, the speech recognition control will not pickup anything that I say. This is a bit confusing as the speech recognition control is a dictionary based speech recognition system that only understands certain phrases defined by the user.")



While this is running try to say something that the speech recognition control would normally pickup like maybe the word "Cancel" which would stop the script that is saying the text above with the below script.

Code:


SpeakStop( )



Basically, I am looking for a way to use the SpeakStop() command from the speech recognition control (obviously through spoken words) while something is being said by the say command.

Thanks
David

CochranRobotics
Commented April 2016
interesting. if it doesn't work out, we will just have to have things like the news complete prior to the user being able to continue. no big deal as we already break this up into batches, and the user says "next" to hear the next batch of headlines. the user can then say something like "tell me the one about Donald Trump" and it will read the article about Donald Trump.

we also use short answers to questions asked to prevent huge amounts of data from being returned when natural language is more like short answers instead of long Wikipedia articles.

if we can't make it work, it's just a bit of a nuecence instead of a show stopper.
DJ Sures
Commented April 2016
You could just have one keyword that is the only keyword active during speech. Such as "Stop Talking" or "Execute Me Robot". Or some phrase that shouldn't be easily fooled
CochranRobotics
Commented April 2016
yea, this is the plan. I think giving a few choices that the user can enter will work. some people will want to "shut up" and others will want to say something like "excuse me". we are all about trying to make it as customizable as possible while still working.
CochranRobotics
Commented April 2016
DJ,

on a side note, using speakstop () when using saywait() causes the speech recognition control to stop working.

getting the error for you shortly. looks like it's an issue with stopping an asynchronous commans.
CochranRobotics
Commented April 2016
Here is the exception:

Code:


Error on line 3: Async operation canceled.



Here is the code with sayWait:

Code:


:MonitorVariable
waitforchange( $EZ_AI_Speech_Response )
sayWait( $EZ_AI_Speech_Response )
$EZ_AI_Speech_Response = ""
If ($EZ_AI_Is_Staged = "true")
ControlCommand("Script Manager", ScriptStart, "EZ_AI_RecordAndSendSpeech")
EndIf
Goto( MonitorVariable )



Here is the code with speakStop:

Code:


:MonitorVariable3
waitforchange( $EZ_AI_Cancel )
SpeakStop()
$EZ_AI_Speech_Response=""
ControlCommand("Script Manager", ScriptStart, "EZ_AI_MonitorAndSpeakSpeechResponse")
$EZ_AI_Cancel = "false"
Goto( MonitorVariable3 )



Let me know if there is anything you see we are doing wrong or if you want us to do something different.

Thanks
David

Question
AvatarCochranRobotics
Asked on Thursday, April 21, 2016