Asked — Edited
Resolved Resolved by WBS00001!

Variables For Speech Reco

Hello,

i am asking me one question:

Have i the possibilty to set a variable in the Speech Commands?

To understand what i mean:

I want to ask the Robot:

Do you like "x" ( and now i can say what i want)

like:

Do you like fishing? Do you like drinking? Do you like flying?

and so on.

and the robot can give an answer: "Yes i like!"

But the important, is to set a variable!

Interresting also:

I will say: My favorite music is "x"

Now the robot will remember the "x" (in this case it will be "Hip Hop")

And the Robot will answer:

Hip Hop (from the variable) i like also!

i think this is more complicate then the first idea, there the speech reco only must understand the start or the end of a sentence.

So it is possible?

Boris

PS: For what i need this Commands:

$SpeechConfidence

and $SpeechPhrase

?

I check out the forum and the manual, but i really find nothing about it.


ARC Pro

Upgrade to ARC Pro

Unleash your robot's full potential with the cutting-edge features and intuitive programming offered by Synthiam ARC Pro.

#33  

Hi Boris;

I'm not sure if you meant this line to be the defining of a variable: ReadScript = C:\spiegel_answer.txt

If so, it should go like this: $ReadScript = "C:\spiegel_answer.txt"

Anyway, there is a script command that can read an entire file at once:
FileReadAll( filename )

Using the $ReadScript from above, It would be used like this: $TheScript =FileReadAll($ReadScript)

So that can read a script from a file. The problem is there is nothing you can do with it. To execute a script, it must be in a script control and then that script control would be run. Unfortunately there is no command or instruction that will put text into a script control. No command that can copy text from a script control either for that matter. There is also no way that I know of that can run a script from a variable.

#34  

Hello Boris;

I just wanted to mention that I have the program working to where it will copy the Speech Recognition phrases and scripts from the Speech Recognition control in an .EZB project file and create the data, in the proper format, for placing those phrases and scripts into the SR_Eval script by pasting it in.

The program has not been tested much yet, so I am hesitant to send it out to be used by others. However, I thought it might be helpful to you if you uploaded a copy of some project of yours that has all the phrases in it. You could save it to the cloud briefly and I could download it for modification and put the result back up to the cloud for you to download.

There is a way to make a project with only the Speech recognition control in it so that you would not have to upload a project with everything else in it just to do this one thing. If you wish to do that I can give you detailed instructions on how to do it. Once you download the project with the modified Speech Recognition control, you can import it into whatever project you like using a blank Speech Recognition control and an a blank SR_Eval script. That can be done using the "Merge" function.

If you don't wish to do this, that that is fine and I completely understand. I just thought I would mention it so you could work with this method for all your phrases as soon as possible. It only takes a few seconds for the program to do this so I can upload the modified project to the cloud within minutes of downloading yours. Assuming nothing unforeseen happens during the conversion process. Which is another reason for me to to it this first time since I can fix whatever goes wrong on the spot.

#35  

Hello WBS000001,

sorry about my delay! I make free on sunday from roboics. ;-)

I really not complete understand what you me with upload and downbload the project, do use thos copy software for the speech commands.

i understand this will copy all speech command from the speech control to a file and then past this to the SR_Eval Script? Right.

So this is interesting if i have a lot of speech commands and now i am starting the SR_Eval Script. So i don't must write the hole script again to the SR_Eval Script, this will do the Software automaticly?

My problem is i am at the beginning, so my hole command are also in the SR_Eval Script.

But i have a old EZB Project with commands what i really like to copy to the SR_Eval Script i my new EZB Project.

There its interessting. SO i must upload the old project to the EZB Cloud?

To the Question with the scripts in a external text file, i understand that i only can use the textfile for reading a text, not for scripts. Not everything is easy ;-)

But (sorry) back to my idea for variable sentences:

I had and idea for a script like this:

Quote:

if($SpeechPhrase ="wie spat ist es") elseif ($SpeechPhrase ="wie fruh ist es") SayWait("Nach meiner Uhr ist es jetzt 13:00") endif

another idea what your are posting:

Quote:

if($SpeechPhrase ="wie spat ist es" or "wie fruh ist es") SayWait("Nach meiner Uhr ist es jetzt 13:00") endif

I have saved both commands "wie spat ist es" and "wie fruh ist es" in the Speech Control.

But both Scripts will not work. I understand that i can't make complete diffrent sentences, i think they must start with the same letter, what in this case is the "w".

Or i am completely on the wrong way?

Boris

#37  

HI bhouston,

thanx for your link, but i want to have it complete opposite.

I say 2 or 3 diffrent sentences and i will hear the same answer.

I german we have a lot of variable to ask something. The sentences starts allmoust the same;

Wie heiBt du? Wie ist den Name? Wie wirst du genannt? (how is your name?)

All starts with "Wie" but means the same.

Or:

Wie geht es dir? Wie gehts dir?

(How are you?)

2 only little bit diffrent sentences, but diffrent ... but means the same,

If i will make for every important variable a command, my script will be huge!

The same with "What is the time"

in German

Wie spat ist es Was sagt die Uhr Was sagt die Uhrzeit Wieviel Uhr haben wir

all means "What is the time"

I like this Script "SR_Eval" from WBS00001 for the possibilty to pause and unpause the speech reco. But if i must copy the "What is the time" script 4 times, you can image how long the SR_Eval script will be. And if there is to much inside the script, it will be hard and confuse to work with.

DO you understand the problem?

I don't want to have 20 or 60 Speech Commands. I think they can be 200 diffrent (incl. variables) Speech Commands. And this will be a big Script.... i must scroll 5 minutes to come to the end ;-)

Boris

#38  

So this might work; Have these different Phrases in Speech Reconition;

Hi Hello Good day etc. and they would all run a script like the following;


$response = GetRandomUnique(0,5)

if($response = 0)
Sayezb("Hello Boris")

Elseif($response = 1)
Sayezb("how's it going")

Elseif($response = 2)
Sayezb("what can I do for you?")

Elseif($response = 3)
Sayezb("Hello")

Elseif($response = 4)
Sayezb("What's up")

endif

#39  

Hi Boris;

Now it is my turn to apologize for not getting back to you sooner.

Quote:

i understand this will copy all speech command from the speech control to a file and then past this to the SR_Eval Script? Right.

But i have a old EZB Project with commands what i really like to copy to the SR_Eval Script i my new EZB Project.

There its interessting. SO i must upload the old project to the EZB Cloud?

Yes. That is correct.

Be sure to click the box that says "Is public" at the bottom of the upload page so I can access and download it. When I do, I can get all the parts of the Speech Recognition control and format them for the SR_Eval script. I will place an SR_Eval script on the project and paste the modified phrases and scripts from the Speech Recognition control into the new SR_Eval script.

This process will also modify what is currently in the Speech Recognition control with the same phrases that are in it now, but they will be in alphabetical order. In the script part for each phrase will be just a "#" character. There has to be something there to prevent the Speech Recognition control from erasing the phrase. It doesn't always erase it, but it's better to be sure. You can put some text there after the # character to describe what the phrase is for if you like but that is not required.

EDIT If there is already a # as the first character in the first line of the existing script for a given phrase, whatever else is in that line will also be kept as it is because it is already a comment line. That way, if you already have a comment on that first line, it will be transferred to the new Speech Recognition control so you won't have to type it in again.

I am not putting the "search" code for each phrase like I have in the ESRP. If that is desired later I can put it in then.

When I finish the modified project, I will upload it to the cloud for you to download. I will name it differently by adding "_MOD" to the end of the project name. That way there will be no accidental overwriting of the project you sent to me.

Once you have the modified project and verify it works I can give you instructions on how to merge it with another project.

NOTE: It is possible to add what is in the Speech Recognition control in the modified project with what is already in a Speech Recognition control in another project. If you do it that way, however, what you already have in the Speech Recognition control in the other project will not be in alphabetical order after the merge operation. It would be best to add the phrases and scripts you have done recently using the ESRP project to the ones in the old project that you are going to send to me. That way everything will be included in the new SR_Eval script.

#40  

@bhouston

Quote:

So this might work; Have these different Phrases in Speech Reconition;
The problem that Boris faces is that he does not want to have all those phrases and their variations in the Speech Recognition control. He would like to have just one version actually in the Speech Recognition control but somehow have the evaluation script for that one phrase work with all the variations as well.

So far, that simply does not seem to be a possibility because of the way the Speech Recognition control works. It get's good accuracy because it doesn't have to figure out what the speech input means. It only has to match it to one of the phrases in the Phrases area of the control. It then gives an output on what it thinks is the best match.