Author Topic: How do I use wildcards  (Read 3091 times)

angelus1753

  • Newbie
  • *
  • Posts: 6
How do I use wildcards
« on: May 14, 2021, 03:12:47 AM »
As far as I can find in the forum the wildcard should store it's value, but I can't get it to work;

I have this simple command: 'Change frequency to *'
I log the output:
Write '{CMD}' to log
Write '{CMD_BEFORE}' to log


But the result is blank.
The command is recognised and stops listening BEFORE I can say the wildcard. It starts writing the command:
11:05:44.781
11:05:44.779 change frequency to
11:05:44.770 Recognized : 'change frequency to' (Confidence 84)


So it doesn't even tries to pickup the wildcard.


I'm running Beta 1.8.7.15 (x64) on Windows 10  (10.0.19042 Build 19042)

Is this a bug or am I missing something glaringly obvious?

THanks


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4757
  • RTFM
Re: How do I use wildcards
« Reply #1 on: May 14, 2021, 07:41:11 AM »
Are you using Speech Platform 11? That does not support dictation (as mentioned here), which is what wildcard commands rely on

If not, what are your recognition delays as set on the "Recognition" tab of the VoiceAttack options window?


If you do get the command recognized correctly, note that "{CMD_BEFORE}" would still return "" with that command, given that there is nothing before your defined phrase, only after it.

angelus1753

  • Newbie
  • *
  • Posts: 6
Re: How do I use wildcards
« Reply #2 on: May 16, 2021, 12:19:39 PM »
I have tried all sorts of speech engines. I uninstalled some stuff, and am now left with 'system default' and 'lightweight 11' . The compatibilty error that VA then throws says I need to install both speech platform 11 AND a selected language.

You now tell me it's not supported.

You link to the most confusing help page in the world. I just can't get from there what I need to install.
I'm running an english windows and my english is rather good.
So what is the defealt and how do I get VA to use that?
If I can't use the default windows speech thing, what do I use? I've tried the 64b installer and that one worked pretty good. But according to you that's not the one I want because it doesn 't do wildcards.
Again, what do I use then???
Are none of the speech engines supported??

I'm really confused; I really could use some help now

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4757
  • RTFM
Re: How do I use wildcards
« Reply #3 on: May 16, 2021, 12:40:18 PM »
It's not that VoiceAttack doesn't support dictation when using Speech Platform 11, but rather that Microsoft didn't design that engine to have that feature. I.E. Speech Platform 11 is incapable of performing that task.


If you did want to use Speech Platform 11, you would need both the runtime and an engine for a specific language, yes.

If you don't want to use Speech Platform 11, you need to make sure the "Use Built-In SAPI Speech Engines" option is selected on the "System / Advanced" tab of the VoiceAttack options window.
Should that option be grayed out, that indicates you do not have the speech recognition components installed for any of the "Preferred languages" present on your system. In that case you'll want to check whether a download button is present, as described here, assuming you are using a language that has a speech recognition engine available (denoted by a microphone icon, as mentioned in the linked topic)

Once VoiceAttack has been set up to use the SAPI engine, you'll also want to train your speech recognition profile, assuming you haven't done so previously. Run through the training at least three times.

angelus1753

  • Newbie
  • *
  • Posts: 6
Re: How do I use wildcards
« Reply #4 on: May 16, 2021, 12:57:08 PM »
I have reinstalled SpeechPlatformRuntime64.msi, MSSpeech_SR_en-US_TELE and MSSpeech_SR_en-GB_TELE.
deleted VoiceAttack.dat

So in VA I tried
 - Installed Speech Platform and tried both System Default and 11 light: No recognition of any command
 - SAPI speech engine, and tried System default/Microsoft speech recognizer 8.0 for Windows UK and US: Recognises commands, but not the wildcard commands were recognised.

What do I try next?

(btw, I'm a bit frustrated that this costs me so much time, but I really appreciate you helping me out...)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4757
  • RTFM
Re: How do I use wildcards
« Reply #5 on: May 16, 2021, 01:15:53 PM »
The "lightweight" entry in that list does not appear to be a working engine. It's in there because the system reports it when VoiceAttack queries the list of installed engines. If Speech Platform 11 is fully installed, there should be an entry for each installed engine in that list


For the SAPI engine, are commands containing wildcards not recognized at all, or recognized immediately when you speak their phrase, like before?

In case of the former, is there an "Unrecognized" entry in the log on the main window when you speak the command? If there is no entry at all, right-click the log and make sure "Do not show unrecognized items" is not checked).
If there is an entry, does it actually match the command phrase? E.G. if you're speaking "change frequency to", is that what the engine is recognizing?

As mentioned, wildcards use the dictation features of the engine, which means it must attempt to freely recognize what it hears, without context, after which VoiceAttack will check the output to see if it matches a wildcard command phrase (unlike normal commands, which are passed to the engine so that it can compare what it heard to the predefined list of phrases).
Because of that, your speech recognition profile needs to be well-trained, and your speech recognition environment (including your microphone) needs to be well-suited to this task.

angelus1753

  • Newbie
  • *
  • Posts: 6
Re: How do I use wildcards
« Reply #6 on: May 16, 2021, 01:35:02 PM »
The "lightweight" entry in that list does not appear to be a working engine. It's in there because the system reports it when VoiceAttack queries the list of installed engines. If Speech Platform 11 is fully installed, there should be an entry for each installed engine in that list

That does not appear to be the case. Is there a way to install the FULL speech platform 11??


For the SAPI engine, are commands containing wildcards not recognized at all, or recognized immediately when you speak their phrase, like before?
Like before. It recognises the command, but stops listening immediate after. No wildcard is read. The command is matched >90
I've run the trainer for the 5th time. I'm using it to read frequencies for MSFS, and it seems to read the command perfectly and if I mention a frequecy (like 123.45) it comes up as unreconised, but the numbers are often correct.

Is there perhaps another way to pass a variable to the target application (I'm planning to use the msfs 3rd party app that I found for VA)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4757
  • RTFM
Re: How do I use wildcards
« Reply #7 on: May 16, 2021, 02:13:02 PM »
That does not appear to be the case. Is there a way to install the FULL speech platform 11??
There are only two installable components required, that being the runtime and an engine for a specific language.
However, you mentioned that you're using the 64bit beta, which could be the issue as the files on the linked page are likely 32bit versions (for now, as there is no full release of the 64bit version yet).


Like before. It recognises the command, but stops listening immediate after. No wildcard is read. The command is matched >90
I've run the trainer for the 5th time. I'm using it to read frequencies for MSFS, and it seems to read the command perfectly and if I mention a frequecy (like 123.45) it comes up as unreconised, but the numbers are often correct.
Which values are you using for the "Recognized Speech Delay", "Unrecognized Speech Delay", and "Command Weight" options on the "Recognition" tab of the VoiceAttack options window?

Have you tried creating a new, profile, with only the wildcard command in it?


Is there perhaps another way to pass a variable to the target application (I'm planning to use the msfs 3rd party app that I found for VA)
Passing information to another application does not require wildcards at all, by itself.

If you're referring to speaking numbers without using wildcards, that is possible, but the reason wildcards are usually used for that type of application is that predefining a large numeric range generates a very large number of command phrases, which can lead to VoiceAttack throwing exceptions or even crashing (with the 32bit version, because it runs out of memory), or the speech recognition engine itself crashing (with the 64bit version, which allows VoiceAttack itself to use more memory)

For normal aviation VHF frequencies, you could use the command phrase "change frequency to [118..136].[0..39,25]", which generates a fairly reasonable 760 phrase variations (using numeric ranges in dynamic command sections. More information on these features can be found in the "1 - Command Input" subsection of the "Command Screen" section of VoiceAttackHelp.pdf; press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer)

The "{CMDSEGMENT:}" token can then be used to retrieve the spoken numbers.


For larger ranges, or a profile with many commands containing numeric ranges, reducing the amount of predefined spoken phrases is usually inverse to the fluidity a command phrase can be spoken with, as separating a single number into multiple sections, requires a pause between each spoken section.

E.G. you could have the phrase "change frequency [118..136]" trigger a command, to get the Mhz portion of the frequency, and then use a "Wait For Spoken Response" action with the phrase ".[0..39,25]" to get the Khz portion.
This command would need to be spoken like "change frequency 123... point 50", pausing for the command to get recognized initially before speaking the second section, but it only generates 19 phrase variations for the command itself, and 40 variations for the "Wait For Spoken Response" action, for a total of 59 variations (quite a bit less than the 760 for the single command phrase)


To get a feel for which phrases are generated, particularly when using dynamic command sections, this command may be of use.

angelus1753

  • Newbie
  • *
  • Posts: 6
Re: How do I use wildcards
« Reply #8 on: May 17, 2021, 10:03:06 AM »
Okay; I've been testing some more.
I have no clue how to install a 'full version' - I installed a 64bit package, but that might not be 'full' or complete enough. Unfortunately to support msfs direct connect I'll need a 64b VA.

Values for Recognized speech delay and such are all standard; I reinstalled and removed the original DAT file, so yes it's a new profile. That can't be it.

Your last point did give me some pointers. But I really could use your help there.
I would like to use the command 'Set COM1 to 118.5' -  COM1 and 'to' are very unstable, so lets make that:
'Set Radio 118.5'

and I need it in a variable 'FREQ' as text to send it to MSFS. So '118.5' should become a string in a variable

Can you provide me with a command on how to do that?
I really didn't understand the 'Wait For Spoken Response' hint'; Manual doesn't give any info on it :(
Is it a checkbox somewher? what is it?
Using  [118..136].[00..995] is rather much I found out. Please, if you can, could you spell it out for me???

Oh and how do I import those example codes is see on the forums? I know how to export it, but I can't find a way to import that. Which means I just have to go and test all variations with braces and quotes to work out what I need to put in what field.

Thank you

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4757
  • RTFM
Re: How do I use wildcards
« Reply #9 on: May 17, 2021, 11:17:11 AM »
I really didn't understand the 'Wait For Spoken Response' hint'; Manual doesn't give any info on it :(
If you search VoiceAttackHelp.pdf for "Wait For Spoken Response", your PDF viewer should take you directly to the "‘Get User Input – Wait for Spoken Response’" subsection of the "‘Get User Input’" subsection of the "‘Other Stuff’ Screens" section.

It's an action that can be added to a command, to have the command wait for spoken input after it has already started executing.

Using  [118..136].[00..995] is rather much I found out.
Which is exactly why that's not what I used in my example.

As mentioned, limiting the amount of generated phrases to the ones you will actually be using is important. E.G. aviation VHF frequencies are usually 25Khz apart, or at the very least more than 1Khz apart, so you don't need every single frequency, just the ones that are actually used.

Oh and how do I import those example codes is see on the forums?
You don't. You look at the command in its context, extrapolate which options would fit what is shown with the aid of the documentation, then add the actions to your command manually, and hopefully learn something about the features you're using while doing so.

These topics may be of use in addition to the official documentation:
Control flow (If, Else, ElseIf, Loop, Jump) basics
Variables and tokens summed up



There is a modification required to the command phrase, regardless of the chosen approach, as otherwise there is no distinction between .025 and .250

Because of this, the "{TXTNUM:}" token, combined with the "{CMD}" token, is a better option than the "{CMDSEGMENT:}" token, when using a single phrase.

E.G.
When I say Set radio [118..136].0;Set radio [118..136].0[1..3,25];Set radio [118..136].[4..39,25]
Code: [Select]
Set text [FREQ] to '{TXTNUM:"{CMD}"}'
Execute external plugin, '<your MSFS plugin here>'
Write [Blue] 'Tuned to {TXT:FREQ}' to log



The "{CMDSEGMENT:}" token is still useful when using the "Wait For Spoken Response" action, however.

E.G.
When I say Set radio [118..136]
Code: [Select]
Wait for spoken response: 'point 0;.025;.050;.075;. [4..39,25]'
Set text [FREQ] to '{CMDSEGMENT:1}.{TXTNUM:~response}'
Execute external plugin, '<your MSFS plugin here>'
Write [Blue] 'Tuned to {TXT:FREQ}' to log

On my machine I found that "point 0" was recognized much more reliably than alternatives like ". 0" or ".0"

The speech recognition engine uses a built-in linguistic ruleset from Microsoft, which gives it something of a mind of its own when recognizing certain phrases.
E.G. when speaking "point zero two five", it would normally output that as "0.025"

With the predefined phrases written the way they are in the example, recognition accuracy was reasonable on my machine.

angelus1753

  • Newbie
  • *
  • Posts: 6
Re: How do I use wildcards
« Reply #10 on: May 22, 2021, 06:45:29 AM »
Hi
I wanted to get back to you several times, but I continuously got distracted and didn't finish my posts; I apologize for that because your help has been excellent (and timely!).
I go it to work with your instructions and am greatfull for that. The spoken response commands I still have to look into. The current problem I have is that even though the command is sent to MSFS it's not doing anything with it, but that's not VA related.
So in all a massive thumbs up for your help!

Marco