Author Topic: Random confirmation / negative sounds  (Read 953 times)

GMRod

  • Newbie
  • *
  • Posts: 7
    • My portfolio!
Random confirmation / negative sounds
« on: June 24, 2021, 03:06:54 PM »
Hey guys!

So I'm trying to set up Voice Attack so that it seems like an actual bot is doing stuff for me on stream.
I have it -almost- where I want it now, figured out how to get it to send commands to SLOBS, my chatbot, the works.
I'm only missing the bot's voice.
I'll get a voice actor to record the lines for me, but first I need to figure out one last thing:

Is there a way to have VA do random confirmation and negative sounds for when it runs commands / doesn't understand you?

The idea is to have a bunch of like "Yes sir", "Right away sir" etc etc
And "I'm sorry sir, I didn't catch that" for when commands don't work.

The obvious way to have the confirmation ones work, is to just add a "play audio file" to each command, right.
But this would be bad for two reasons:
1- Too much work adding it to EACH command
2- Every command would have the SAME confirmation sound every time I do that command.

What I need is to have like, folders, right. One folder contains all the confirmation sounds and every time a command is run, it randomly picks one from the folder and plays it.
If this works, it'd be fine adding the random thing to each command because in this case it'd just be a copy+paste.

Then, same thing for the commands that don't get recognized.
BUT, this one has an extra caveat.
Since I'm constantly talking on stream, it'd be HELLA annoying if it kept saying it didn't catch whatever I'm saying.
So I need ideas here. A cooldown? % chance it plays? How to solve this one?

Thanks in advance guys!

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Re: Random confirmation / negative sounds
« Reply #1 on: June 24, 2021, 05:20:27 PM »
Hi, GMRod.

What you'll want to look at first is the, 'Play a random sound' action.  That's the one you'll want to (probably) use for both recognized and unrecognized commands.  In that action, you'll see that you can pick either a directory or a specific collection of files to be randomly played back (with an option to minimize repeated random sounds).

Now for some good news and bad news.  The good news is that if you go into Options from the Profile Edit screen and go over to the Profile Exec tab, you'll see that you can choose a command to run any time a command is unrecognized.  You just need to create a command that plays sounds and reference that from that option.  The bad news is that there is not a fallback command for recognized commands - that means you'll need to add an action that plays sounds to each and every one of the commands that you want to have a response. 

In regards to not replying every single time, you'd want to generate a random number and then see if the number is in range.  If it's in range, play a sound.  Let me know if that sounds out there to you - if so, I'll whip up an example.

Hope that helps!

GMRod

  • Newbie
  • *
  • Posts: 7
    • My portfolio!
Re: Random confirmation / negative sounds
« Reply #2 on: June 26, 2021, 10:14:42 AM »
Hey there!

Thanks for the quick reply.

This all makes a lot of sense to me, actually!
I wouldn't mind adding a play sound action to each command, if they're all the same, as previously stated. One little CTRL+C/CTRL+V won't kill me (even if I have 100+ commands, it's fine).
Now, if I can reference a command for the unrecognized ones so that it doesn't always play something, that's perfect!
The number thing you're suggesting sounds to me like you're about to whip up an IF statement, yes?

Thanks again man!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4758
  • RTFM
Re: Random confirmation / negative sounds
« Reply #3 on: June 26, 2021, 10:27:44 AM »
Referencing a command is relevant to recognized commands as there is no option to execute another command whenever a command is recognized.
Using an "Execute Another Command" action to execute a separate command containing whichever actions you intend to use to randomize or otherwise affect the chances of a sound playing means you don't need to edit every single command should you want to change something in future, like you'd need to do if you use an action (or set of actions) in each command directly.

For unrecognized commands, you can use the "Execute a command each time a phrase is unrecognized" at the profile level.


A basic random chance setup could look something like
Code: [Select]
Set integer [~random] value as random from 1 to 10
Begin Integer Compare : [~random] Is Greater Than 5
    Play random sound (10 items)
End Condition
This would allow you to try and influence the chances of the sound playing, E.G. checking whether the value is greater than 2 for a higher change, or greater than 8 for a lower chance.

Depending on how much noise your microphone picks up, a low chance may be advisable for unrecognized commands.


A random chance is just that, however: Random. By all means give it a go, but you may want to consider putting together a system that takes into account the time since the last response was played, for example, to prevent one response after the other some times, and seemingly no response at all other times.

GMRod

  • Newbie
  • *
  • Posts: 7
    • My portfolio!
Re: Random confirmation / negative sounds
« Reply #4 on: June 30, 2021, 08:23:34 AM »
Awesome stuff guys.
When I get the voice recorded, I'll get on this.

Thank you so much!