Author Topic: Confirmation_beep.wav after a recognized phrase?  (Read 3552 times)

Windblow

  • Guest
Confirmation_beep.wav after a recognized phrase?
« on: May 11, 2018, 02:23:47 AM »
Hello all,
I try to make to sound confirmation_beep.wav or failure_beep.wav after a spoken command.

I tried to add a new command without any input (novoice, no mouse, no ...)and just play sound as Action. and checked in profile Options Execute command if recognized (or not). but it does work ...

I must be an idiot, but maybe someone could give me some advices...

I use v1.7.0.4 ( prerelease) and in PTT mode.

Windblow

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Confirmation_beep.wav after a recognized phrase?
« Reply #1 on: May 11, 2018, 06:16:47 AM »
There is no built-in method to execute a command or play a sound for all recognized commands, only unrecognized phrases.

For the latter you'll want to assign a command to the "Execute a command each time a phrase is unrecognized" option.


If you want recognized commands to play a sound, you'll have to add a "Play a Sound" action to each individual command.



In theory you could use some of the tokens to build such a system, but it comes with serious limitations.

The basic setup consists of two commands; One to set a flag that determines whether the command is unrecognized, and one that continuously runs in the background to monitor the command counter and play sounds depending on the status of the unrecognized flag.

Command Recognition Checker
Code: [Select]
Begin Decimal Compare : [>lastCommandCount] Has Not Been Set
    Set decimal [>lastCommandCount] value to the converted value of {CMDCOUNT}
End Condition
Start Loop While : [1] Equals [1]
    Begin Text Compare : [{EXP: {DEC:>lastCommandCount} = {CMDCOUNT}}] Equals '0'
        Pause 0,01 seconds
        Begin Boolean Compare : [Unrecognized] Equals True
            Set Boolean [Unrecognized] to False
            Say, 'Unrecognized'
        Else
            Say, 'Recognized'
        End Condition
        Set decimal [>lastCommandCount] value to the converted value of {CMDCOUNT}
    End Condition
End Loop
Make sure to check the "Allow other commands to execute while this one is running" option is checked.

Assign this command to the "Execute a command each time this profile is loaded" option.


Unrecognized (voice disabled)
Code: [Select]
Set Boolean [Unrecognized] to True

Assign this command to the "Execute a command each time a phrase is unrecognized" option.


Note that the "Command Recognition Checker" command loop has a 10ms delay before checking the unrecognized flag, this is to avoid a race condition where the flag-setting command finishes executing after the "{CMDCOUNT}" token has already been implemented, and after the loop in the "Command Recognition Checker" command has already come around.


Main limitations: This will make a sound for each command, regardless of execution method. E.G. if you trigger a command with the keyboard, it'll still make a sound.

Using a "Stop all Commands" action, or equivalent, will stop the monitor command and sounds will no longer play.


You could use the "{SPOKENCMD:}" token to try and work around the former, and to use a plugin or inline function to circumvent the latter, but it's an imperfect solution regardless.

Windblow

  • Guest
Re: Confirmation_beep.wav after a recognized phrase?
« Reply #2 on: May 11, 2018, 02:06:33 PM »
Thanks for the answer Pfeil
not sure to understand everything at the first reading as I am in discovery phase with VoiceAttack.

I don't know if you make a difference between recognizec command and recognized phrases.
Once the phrase (or Spokene command) is recognized, I don't need to know if the commands are executed. I assume that once the phrase recognized, the actions will follow.
I just want to know if what I said in my mic has been understand or not by the computer by a specific sound, at least if not recognized ::)

Edit : In fact, this not if recognized or not, but rejected or not (confidence level higher than the one set)
« Last Edit: May 11, 2018, 02:47:19 PM by Windblow »

iceblast

  • Sr. Member
  • ****
  • Posts: 372
Re: Confirmation_beep.wav after a recognized phrase?
« Reply #3 on: May 11, 2018, 04:45:41 PM »
Well, If I'm reading what your want correctly, you could just use the Profile Options menu. There you can have a command run for unrecognized and or recognized. Just make 2 commands that will play the sound you would like, and add the commands there.

On the Edit a Profile screen, at the top, to the right of the name of the profile, you'll see a box with a check mark in it. That's the Profile Option menu, just click on that, and you'll see the commands I'm refereeing to.


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Confirmation_beep.wav after a recognized phrase?
« Reply #4 on: May 11, 2018, 11:55:43 PM »
you could just use the Profile Options menu. There you can have a command run for unrecognized and or recognized.
Where is the option for the latter?

I see two options:

"Execute a command each time a phrase is unrecognized"
This will trigger each time a phrase is unrecognized, at the same time an "Unrecognized: ''" entry will be output to the log.

"Execute a command each time a dictation phrase is recognized"
This will trigger each time a dictation phrase is recognized, while VoiceAttack is in dictation mode(I.E. a "Start Dictation Mode" action has been used).

iceblast

  • Sr. Member
  • ****
  • Posts: 372
Re: Confirmation_beep.wav after a recognized phrase?
« Reply #5 on: May 12, 2018, 05:39:52 AM »
Sorry, I didn't realize that was for Dictation Mode only, and apparently I didn't read anything right in this thread as well, I was pretty tired at the time, and apparently misread what was said, completely making my post pointless. Sorry, again.