Canada
Asked — Edited

Only 1 Speech Recognition Control ?

Hello Im have many scripts in mind but ARC only allows 1 speech recognition control:( It would be vary handy if we could use many speech recognition controls that we could rename That way we can have sets of speech commands that can be turned on and off when needed

I know there is the SayWait command but that is vary limited as to what it can do plus it is on a timer and pups um a list on the screen that is not wanted a lot of the time

With being able to have many speech recognition controls we could create much better AI scripts with ALOT less coding and way less work arounds that in many cases just will not work

I can scripts with groups of commands in mind but that takes a lot of extra coding and many times when adding new commands I would need to go back and add more lines of code to other commands

I have been thinking about this for over 2 weeks now trying to think of ways to get around it but the best and most simple way would be to have it so we can have many speech recognition controls in the projects


ARC Pro

Upgrade to ARC Pro

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.

United Kingdom
#1  

To script for groups would take 2 extra lines of code per voice command plus a simple one line script which sets a variable for the group.

Script 1, to enable the group "daytime"...


$daytime = 1

Script within the "daytime" group


IF($daytime = 1)
  # Commands in here
EndIf

The voice command script in the "daytime" group will only run if $daytime = 1 If it doesn't then it wont run.

Use whatever you like to set the group to on or off... for instance


:loop
IF($hour > 8 and $hour < 18)
  $daytime = 1
Else
  $daytime = 0
EndIf
WaitForChange($hour)
Goto(loop)

Or even a simple

$daytime = 0

and

$daytime = 1

set to voice commands.

Sure, DJ could probably add in groups to the existing voice command control however in the mean time there are always ways around it, you just need to think a little:)

Canada
#2  

I know how to script for groups have scripted for groups for many many years now but every time I add a new command that is the same as another that does a different thing I will have to go and add more lines of code to other commands

I tend to think a lot and I mean a lot lol I always try to think of every thing that can make a script work and what will stop them from working and what can cause problems down the road If we could use more than 1 speech recognition control at a time it would save ALOT of scripting ALOT of headaches and make AI scripts ALOT more dynamic

It should not take much at all to get ARC to allow more than 1 speech recognition control as most of the code for it is already there just need to set it to allow more than 1 at a time and to have it so we can rename them

United Kingdom
#3  

I responded to your comment:

Quote:

I can scripts with groups of commands in mind but that takes a lot of extra coding and many times when adding new commands I would need to go back and add more lines of code to other commands

2 lines of code, one at the top of the script and one at the end is not a lot of extra coding, this is all that is needed in anything which requires enabling by anything.

I cannot see how adding in 2 lines of code, right at the top and at the bottom of any script is a lot of code, headaches and everything else you claimed it to be. It's 2 lines of code in 2 of the easiest places to find in any existing script.

Taking up additional screen real estate and more than likely more processing resources is not the best option in many cases. Generally, where DJ has limited the controls to only one of that type there is a reason. A solution is to script the 2 lines of code I mentioned.

Grouping is not limited to voice commands, I use a lot of grouping for many different controls. Therefore to add it to one control, while a solution, may not be the best solution.

If you're unwilling to accept help when given it or unable to see solutions offered with an open mind when they don't fall exactly on your idea I will have to fall back on my previous statement made to you in a different topic and am unable to offer my time to you.

Canada
#4  

I can see you just don't understand what im saying and I cant explain it to you any better:( the more commands I add the more lines I have to add to older commands and the more complex a script gets the more that needs to be added to other commands

Im not dealing with simple little scripts im dealing with big mager scripts that just 2 extra lines will not do the job

Why is it every time I make a suggestion that will make ARC better and a lot easier to use it causes a big problem:(

I give up i will never make another suggestion again:(

PRO
Synthiam
#5  

Wolfie, I won't let you leave;) you're an important part of our community.

As for more than one speech recognition - it's impossible. The windows API and ARC design doesn't allow it. Im unable to type on my phone the technical reasons why right now.

I would recommend using the AI module we have, or writing scripts:)

Sorry to break the bad news

United Kingdom
#6  

The two lines of code I posted will enable or disable any script or part of script. Adding them to any script would not be difficult regardless of it's size of complexity. If there is part of a script you don't want to be run under certain circumstances surrounding it with an If and EndIf will give you that control over it. I use this method a lot with Melvin to enable/disable certain actions, behaviours and controls based on time of day, day of the week, month, temperature, previous actions carried out, information Jarvis feeds to him, and his mood amongst other things. I can assure you it is as simple to implement as I have explained and works very well.

I understand exactly what you are saying, you want groups of commands that can be enabled or disabled. What I don't understand is how your proposed extra voice controls will make current scripts any easier to have such a control over. If my suggestion wont work your suggestion, or at least how you think it may work doesn't make sense.

I don't want to discourage anyone from asking questions or posting ideas however when I take the time to provide a working example of a solution that's instantly dismissed because it's not exactly what's been requested that's how a problem is caused. We had a very similar situation in a few other topics recently (email and controlling a switch to name two from the top of my head).

If you don't believe the solutions I have posted would work at least provide details of any errors in them which you have encountered. However if you're unwilling to try solutions I have provided or unwilling to provide detailed responses relating to errors or problems implementing them then I am wasting my time which is something I would rather not do, if that's going to be the case tell me and I will leave it for others to attend to.

#7  

Hang in there, Wolfie. No-one meant any harm. He just asked you to have an open mind. That is easy for me, cause my mind has a big hole in it, ha!ha! It's all good!

PRO
Synthiam
#8  

Lol, that makes two of us. My mind seems to be quite forgetful lately! Trying to pack too much in my little head

#9  

@Rich or anyone, I think this is still on topic. At least I hope it is;

I'm still really learning script structure and how and when to set up and use scripts. Up to this point I've been writing simple scripts that either turn on and off a few things and move motors to points. Some of them even have IF, ElseIf and EndIf statements, loops and such. Sometimes I struggle to even understand the logic within these simple scripts. I'm very curious about what the "Grouping" of scripts is all about Rich and Wolfie are trying to discuss. This is the first time I've heard of this. Is there an simple way to explain this concept? Heck, Maybe I'm already doing it and don't even know it.

Thanks @Wolfie for bringing this up as it's opened up a new way for me of looking at how to write scripts and structure my project. :)

#10  

@Wolfie, I agree with DJ. Don't go anywhere. You may not like the answers when they aren't what you were looking for, but you have great questions that genrate lots of interesting solutions and workarounds.

Just be aware, when you ask for a new feature, there are creative minds here who will try to figure out how to deliver the same functionality with existing features and interfaces. Doesn't mean the feature won't be developed, but if you give the suggestions a fair shot, you may have the function you need sooner.

Alan

United Kingdom
#11  

@Dave, it's about the ability to enable/disable more than one script or command at the same time. I believe @Wolfy had the intention of pausing the voice control with the scripts in which he didn't want to be run while having other voice controls still enabled for other scripts or commands.

I use the method explained in my first post in this topic to basically enable or disable scripts for a few things. For instance, I have a "wake up" script which has Melvin tell me to wake up, reports the time, the weather and my agenda for the day. Which is great on Monday to Friday but weekends I like to sleep in.

While I could have done it a different way I have a few other scripts I don't want to be run during the week days either. So, to stop all of these scripts in the "weekday" group I simply added in the variable $WeekdayMode, have a script running constantly which sets the variable to a 1 or a 0 depending on the day of the week...


:loop
IF($dayName = "Saturday" or $dayName = "Sunday")
  $WeekdayMode = 0
Else
  $WeekdayMode = 1
EndIf
WaitForChange($dayName)
Goto(loop)

This checks the day using the variable $dayName (which gets the current day name based on the PC clock) sets the variable $WeekdayMode to a 1 or a 0, waits until the variable $dayName changes then loops around.

In any script which I don't want run at weekends or only want run during the week I use the IF statement to check the status of the group. If the IF statement returns true (i.e. if it was run now and the statement asked if $WeekdayMode was 0) then the script runs. If it returns false it jumps to the EndIf.

The IF statement is at the top of the script, it's the very first line. The EndIf is the very last line.

A similar example Melvin has is to do with his moods. For varying reasons his mood can change, this is set by a variable which is set to either "happy", "sad", "bored", "tired" and "angry" amongst others.

I have voice commands that have him tell me a joke, tell me a bit of trivia, roam the house freely, dance, follow me, look for me etc. but to make him seem more lifelike he will only do these things if he is happy or bored. If he is sad, tired or angry he will refuse to do them.

This is done the same way. A simple IF statement at the very top of the script;

IF($mood = "happy" or $mood = "bored")

Then the script to do whatever the function is, i.e. get the joke and speak it. and then the

EndIf

right at the very end of the script.

However in this example I also use ELSE. When he isn't happy or bored I wanted him to give me attitude. So I added in the Else right at the end of the script;

ELSE
  ControlCommand("Script Manager", ScriptStart, "Give Attitude")
EndIf

By using the IF statement as the first line in the script you can choose to either have the script run or have the script skipped.

Wolfy's idea to have multiple voice command controls so you can pause/unpause them yet still have other voice commands work could be as simple as having group variables i.e. $group1 $group2 $group3 $group4

To enable or disable them set to 0 or 1 as above.

In each script in the voice command control add in the IF at the top and the EndIf at the bottom.

This would also allow for scripts to become members of multiple groups, i.e.

IF($group1 = 1 or $group2 = 1)
  # The script...
EndIF

This would have the script run if either group 1 or group 2 was enabled. Using AND rather than OR could even have specific scripts or voice commands work only if a combination of groups was enabled.

The groups would be easy to turn on or off with simple scripts which run;

$group1 = 0

and

$group1 =1

And those commands could even be used in other scripts so a script can enable/disable a specific group or groups.

Hopefully that makes sense and clarifies what "groups" are. If not I will knock up an Example Project tomorrow to demonstrate what it does and how simple it is to implement.

#12  

Thanks for taking the time to explain this@Rich. It's much clearer now. cool cool

I pause the voice recognition or even turn it on and off all the time within scripts I'm running after I send a vouce command. I do this when I don't want it to pick up any audio and react when that file is playing. Sure, I have to add the on, off or pause (ms) commands but I thought that's the way it is.

United Kingdom
#13  

I do the same on Jarvis otherwise he talks to himself or picks up the TV and turns off the lights or turns off the TV while I'm watching it.