Author Topic: Speech-To-Text Help  (Read 2337 times)

ghettochild_2600

  • Newbie
  • *
  • Posts: 5
Speech-To-Text Help
« on: June 16, 2020, 01:13:04 PM »
Having trouble figuring this out and can't seem to find much about setting this up other than what's in the manual. I'm simply trying to setup a command that allows me to search (CTRL+F) by saying a word. Thank you.

Press Left Ctrl+F keys and hold for 0.06 seconds and release
Start Dictation Mode (Clearing Dictation Buffer)
Set Windows clipboard to '{DICTATION}'
Press Left Ctrl+V keys and hold for 0.06 seconds and release
Stop Dictation Mode

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Speech-To-Text Help
« Reply #1 on: June 16, 2020, 01:16:34 PM »
The "Start Dictation Mode" action does not pause command execution, so you'll need to use another action to wait until you've actually spoken something (or until the speech recognition engine hears something it interprets as speech, at least).

E.G.
Code: [Select]
Press Left Ctrl+F keys and hold for 0.06 seconds and release
Start Dictation Mode (Clearing Dictation Buffer)
Start Loop While : [{DICTATION}] Equals ''
End Loop
Stop Dictation Mode
Set Windows clipboard to '{DICTATION}'
Press Left Ctrl+V keys and hold for 0.06 seconds and release

ghettochild_2600

  • Newbie
  • *
  • Posts: 5
Re: Speech-To-Text Help
« Reply #2 on: June 16, 2020, 01:54:17 PM »
Alright, that seemed to do the trick. There is quite a bit of delay between saying the word and when it gets copied to the search field. Any way to speed that up? I think I saw something about it showing you the letters 1 at a time while you're saying something? Also it doesn't let me use the word dictation when searching. I just get unrecognized " 'dictation' . Actually a lot of words seem to get unrecognized... Windows voice recognition is trash compared to other stt. Any way I can use a different one for VA?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Speech-To-Text Help
« Reply #3 on: June 16, 2020, 02:10:45 PM »
There is quite a bit of delay between saying the word and when it gets copied to the search field. Any way to speed that up?
The only perceivable delay should be the speech recognition engine processing what it heard, which doesn't normally take very long (a few hundred ms perhaps).

Do keep in mind that speech recognition in general works best with predefined phrases. While the Microsoft speech recognition engine can interpret speech freely without context, it'll be much less accurate than when it's matching what it heard to a list of predefined commands.

I think I saw something about it showing you the letters 1 at a time while you're saying something?
That's not something the Microsoft speech recognition engine does, as far as I'm aware.

Also it doesn't let me use the word dictation when searching. I just get unrecognized " 'dictation'
If the dictation mode is active, that word should be recognized like any other.
You do need to pause between triggering the command and speaking your dictation phrase, I.E. wait for the "Recognized" log entry to appear before you start speaking again.

ghettochild_2600

  • Newbie
  • *
  • Posts: 5
Re: Speech-To-Text Help
« Reply #4 on: June 16, 2020, 05:33:56 PM »
I appreciate all the help. I found this code that another user posted which is working quite well and showing the letters being typed out.

in open browser window:

Press Left Ctrl+F keys and hold for 0.06 seconds and release
Pause 0.25 seconds
Press Back key and hold for 0.06 seconds and release
Start Dictation Mode (Clearing Dictation Buffer)
Start Loop While : (Keyboard Key 'Enter' Is Not Pressed AND [endDictation] Equals False)
    Start Loop While : ([{DICTATION}] Equals '' AND Keyboard Key 'Enter' Is Not Pressed AND [endDictation] Equals False)
    End Loop
    Begin Boolean Compare : [endDictation] Does Not Equal True
        Quick Input, '{DICTATION}'
        Clear Dictation Buffer
    End Condition
End Loop
Stop Dictation Mode
Set Boolean [endDictation] to [Not Set]
Write 'Dictation stopped' to log

source:
https://forum.voiceattack.com/smf/index.php?topic=1825.0

I think I'm starting to get the hang of this. It's not perfect, but I'll keep messing around with it.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Speech-To-Text Help
« Reply #5 on: June 16, 2020, 05:37:20 PM »
That example uses the "Quick Input" action which uses keypresses to type out text, however it doesn't actually type what you speak while you speak it, it types what you've already said.

Using the "Set a Text Value to the Windows Clipboard" action is more efficient as you don't need to wait for text to be typed out, provided the target application supports pasting.

Scylipt

  • Newbie
  • *
  • Posts: 3
Re: Speech-To-Text Help
« Reply #6 on: June 26, 2020, 07:57:21 AM »
The "Start Dictation Mode" action does not pause command execution, so you'll need to use another action to wait until you've actually spoken something (or until the speech recognition engine hears something it interprets as speech, at least).

E.G.
Code: [Select]
Press Left Ctrl+F keys and hold for 0.06 seconds and release
Start Dictation Mode (Clearing Dictation Buffer)
Start Loop While : [{DICTATION}] Equals ''
End Loop
Stop Dictation Mode
Set Windows clipboard to '{DICTATION}'
Press Left Ctrl+V keys and hold for 0.06 seconds and release

Im new to VoiceAttack, to the point where I can make simple voice commands. I copied the above code exactly but all that is happening is the find box opens. I cant get to grips with dictation, can you explain the process or have a link to help or a manual of sorts? Am I right in saying that {DICTATION} is the Variable that stores the audio that is then converted to text and copied to the clipboard before pasting in the find box? Are the brackets necessary, are they to highlight that its a variable?

Thanks,

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Speech-To-Text Help
« Reply #7 on: June 26, 2020, 08:09:45 AM »
Press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer.


"{DICTATION}" is not a variable, it is a token. Tokens are essentially functions that return text; The curly braces are necessary for the parser to identify that particular section of text as a token in order to replace it with the output of the function it represents.


What does your action list look like? Right-click it and choose "Copy All as Text", then paste into a code block (click the "#" button) here.

Scylipt

  • Newbie
  • *
  • Posts: 3
Re: Speech-To-Text Help
« Reply #8 on: June 26, 2020, 08:24:07 AM »
Press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer.


"{DICTATION}" is not a variable, it is a token. Tokens are essentially functions that return text; The curly braces are necessary for the parser to identify that particular section of text as a token in order to replace it with the output of the function it represents.


What does your action list look like? Right-click it and choose "Copy All as Text", then paste into a code block (click the "#" button) here.

Code: [Select]
Press Left Ctrl+F keys and hold for 0.1 seconds and release
Start Dictation Mode (Clearing Dictation Buffer)
Start Loop While : [{DICTATION}] Equals ['']
End Loop
Stop Dictation Mode
Set Windows clipboard to '{DICTATION}'
Press Left Ctrl+V keys and hold for 0.1 seconds and release

Ive noticed Equals '' is different. I went inside and set the small integer / another variable option and typed ''

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Speech-To-Text Help
« Reply #9 on: June 26, 2020, 08:30:14 AM »
As mentioned, all tokens output text; Small integer is a numeric datatype.

The loop should be comparing the output of the "{DICTATION}" token to the literal text "", I.E. blank, nothing. It needs to check whether the dictation buffer is empty, and keep looping until it's not.

Scylipt

  • Newbie
  • *
  • Posts: 3
Re: Speech-To-Text Help
« Reply #10 on: June 26, 2020, 08:34:17 AM »
As mentioned, all tokens output text; Small integer is a numeric datatype.

The loop should be comparing the output of the "{DICTATION}" token to the literal text "", I.E. blank, nothing. It needs to check whether the dictation buffer is empty, and keep looping until it's not.

Thanks for that explanation pal, cleared a few things up.