Author Topic: Input numbers via Number pad when voice not heard  (Read 5880 times)

sutex

  • Jr. Member
  • **
  • Posts: 91
Input numbers via Number pad when voice not heard
« on: August 26, 2016, 09:37:42 PM »
Tying to use this , Bearing Calc http://voiceattack.com/SMF/index.php?topic=378.msg1816#msg1816
VA just doesn't like voiced numbers , after adding numbers to WIN speech recognition ,numbers still wont work well enough

Best solution is just to input the numbers Via Keypad , the issue is my Number pad is already been used by other commands

How do you go about , telling VA to ignore , all other commands when using the number pad.

Getting Bearing Calc to either using Voice or Number pad would also be practical , ie

 'Didn't hear that please enter number via Number Pad'

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Input numbers via Number pad when voice not heard
« Reply #1 on: August 27, 2016, 10:33:10 AM »
VA just doesn't like voiced numbers , after adding numbers to WIN speech recognition ,numbers still wont work well enough
VoiceAttack is dependent on the Microsoft Speech Recognition Engine, which doesn't do well with short input of any kind. That's something for Microsoft to improve.

How do you go about , telling VA to ignore , all other commands when using the number pad.

Code: [Select]
Disable Hotkeys
Set Text [NumpadInput] to ''
Start Loop While : [{EXP:1=1}] Equals '1'
    Begin Text Compare : [{STATE_KEYSTATE:NUM0}] Equals '1'
        Set Text [NumpadKey] to '0'
    Else If Text Compare : [{STATE_KEYSTATE:NUM1}] Equals '1'
        Set Text [NumpadKey] to '1'
    Else If Text Compare : [{STATE_KEYSTATE:NUM2}] Equals '1'
        Set Text [NumpadKey] to '2'
    Else If Text Compare : [{STATE_KEYSTATE:NUM3}] Equals '1'
        Set Text [NumpadKey] to '3'
    Else If Text Compare : [{STATE_KEYSTATE:NUM4}] Equals '1'
        Set Text [NumpadKey] to '4'
    Else If Text Compare : [{STATE_KEYSTATE:NUM5}] Equals '1'
        Set Text [NumpadKey] to '5'
    Else If Text Compare : [{STATE_KEYSTATE:NUM6}] Equals '1'
        Set Text [NumpadKey] to '6'
    Else If Text Compare : [{STATE_KEYSTATE:NUM7}] Equals '1'
        Set Text [NumpadKey] to '7'
    Else If Text Compare : [{STATE_KEYSTATE:NUM8}] Equals '1'
        Set Text [NumpadKey] to '8'
    Else If Text Compare : [{STATE_KEYSTATE:NUM9}] Equals '1'
        Set Text [NumpadKey] to '9'
    Else If Text Compare : [{STATE_KEYSTATE:NUM.}] Equals '1'
        Set Text [NumpadKey] to '.'
    Else If Text Compare : [{STATE_KEYSTATE:NUM+}] Equals '1'
        Set Text [NumpadKey] to '+'
    Else If Text Compare : [{STATE_KEYSTATE:NUM-}] Equals '1'
        Set Text [NumpadKey] to '-'
    Else If Text Compare : [{EXP:{STATE_KEYSTATE:NUMENTER} = 1 OR {STATE_KEYSTATE:NUM/} = 1}] Equals '1'
        Write '[Purple] {TXT:NumpadInput}' to log
        Enable Hotkeys
        Exit Command
    Else
        Set Text [NumpadKey] to ''
        Set Text [NumpadKeyPrev] to ''
    End Condition
    Begin Text Compare : [{EXP:'{TXT:NumpadKey}' = '{TXT:NumpadKeyPrev}' OR '{TXT:Numpadkey}' = ''}] Equals '0'
        Set Text [NumpadInput] to '{TXTCONCAT:NumpadInput:NumpadKey}'
        Set Text [NumpadKeyPrev] to [NumpadKey]
    End Condition
End Loop
When you run this command, keyboard shortcuts are disabled so you can use numpad keys to enter a number. Press "Enter" or "/" on the numpad to finish input("Enter" doesn't seem to work currently); the command is stopped and keyboard shortcuts are enabled.

A caveat of this method is that there is no way to keep the keypresses from getting passed through to your application, but it prevents you having to add a check into every command with a numpad shortcut. Pick your poison.


Getting Bearing Calc to either using Voice or Number pad would also be practical , ie

 'Didn't hear that please enter number via Number Pad'
If you have a reliable mic and no background noise, you could add a catch-all command that does this for you; However, as it's very likely you don't have a noiseless input signal in the real world, I'd suggest just using keyboard entry.

sutex

  • Jr. Member
  • **
  • Posts: 91
Re: Input numbers via Number pad when voice not heard
« Reply #2 on: August 27, 2016, 06:36:32 PM »
Thanks for the Code , now I see it , checking manual again for those commands as I can see how its used  ..:)

And yes MS , is the issue , but I thought somehow , VA , might be about to compensate , with Numbers at least by  hardwiring Numbers into the Code there's only 1 to 0 and 'hundred & thousand' are longer words

Any numbers you Say are supplement by  'Didn't hear that ( loop which the user can increase or decrease) please enter number via Number Pad' 

Maybe hardwiring numbers is just a bad idea , but numbers imputing is needed

sutex

  • Jr. Member
  • **
  • Posts: 91
Re: Input numbers via Number pad when voice not heard
« Reply #3 on: August 27, 2016, 07:52:42 PM »
Im stuck on this .

Else If Text Compare : [{EXP:{STATE_KEYSTATE:NUMENTER} = 1 OR {STATE_KEYSTATE:NUM/} = 1}] Equals '1'

Cant seem to figure out the OR command  which command is it from the drop down boxes .. The rest below that line is unclear as well , Manual not much help

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Input numbers via Number pad when voice not heard
« Reply #4 on: August 27, 2016, 09:20:50 PM »
Cant seem to figure out the OR command  which command is it from the drop down boxes
It's not an action. That "OR" is part of an expression token, as denoted by the "{EXP:" at the start. You enter it into the "Variable Name / Token" field of the text compare.

I exported the command for you so you can just import it.
« Last Edit: August 27, 2016, 09:47:31 PM by Pfeil »

sutex

  • Jr. Member
  • **
  • Posts: 91
Re: Input numbers via Number pad when voice not heard
« Reply #5 on: August 27, 2016, 09:37:52 PM »

Thanks mate , trying to learn it ..