Welcome to Synthiam!

Program robots using technologies created from industry experts. EZ-Builder is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.
Get Started

Asked — Edited

Speech Recognition Not Working While Say Command Is Running

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"


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.


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.


Adding the phrase as an exception didn't work either - it's something i tried. It doesn't detect the phrase it is saying, it detects only words that it is saying.

For example, you ask it the weather or news headlines... and suddenly your robot is moving forward and dancing. Because certain sounds are picked up and recognized as false positives.
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.
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
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.

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.
Here is the exception:


Error on line 3: Async operation canceled.

Here is the code with sayWait:


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")
Goto( MonitorVariable )

Here is the code with speakStop:


waitforchange( $EZ_AI_Cancel )
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.