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

Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!

#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.