Author Topic: Get a list of current profile commands or how to query voiceattack.dat?  (Read 7521 times)

RoyMi6

  • Guest
Hi,

I'm writing a plugin that relies on being able to search the current profile commands.

At the moment my solution has been to export the current profile to an XML file which I can easily read in then search manually, but obviously this is a bit of a pain if you update any of your commands as you'd need to export every time.

vaProxy.CommandExists isn't enough because I want to do a search of my own, rather than relying on a literal search for the exact command.

At the moment I take the profile path and just use:
XElement root = XElement.Load("c:\exported-profile.xml");
I then use LINQ to do my query.

Any know how I can load the .dat in a similar fashion, or if there's a vaProxy method I can use to do the same?

Cheers,
Roy


RoyMi6

  • Guest
Re: Get a list of current profile commands or how to query voiceattack.dat?
« Reply #1 on: October 26, 2017, 04:52:41 AM »
No one got any ideas?

Just even what format of the DAT file ("C:\Users\roymi6\AppData\Roaming\VoiceAttack\VoiceAttack.dat") would be a great help.

Roy

TheThingIs

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 278
    • HCS Voicepacks
Re: Get a list of current profile commands or how to query voiceattack.dat?
« Reply #2 on: October 26, 2017, 07:05:47 AM »
the .dat is not something we should be touching really and there isn't any docs about it's format. It's Gary's profile storage and likely not info he'd want to share with us.
The Singularity profile - One profile to rule them all and at HCS we bound them ;)

You see, TheThingIs, eventually you'll be allright.

RoyMi6

  • Guest
Re: Get a list of current profile commands or how to query voiceattack.dat?
« Reply #3 on: October 26, 2017, 07:15:41 AM »
Well, the .DAT file is totally readable by any plain text viewer. Just not very human readable - I just can't immediately see hints to what the encoding might be as it's not something I've looked at for many years.

I mean if someone was truly trying to do anything with the .DAT files (and not just working on it in their lunch break) I don't think they'd have any issue getting out the information they want.

TheThingIs

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 278
    • HCS Voicepacks
Re: Get a list of current profile commands or how to query voiceattack.dat?
« Reply #4 on: October 26, 2017, 07:23:09 AM »
indeed, it's not something I've messed with or looked at tbh. You may be better emailing support@voiceattack.com so that you can direct this privately to Gary as he's the only one who can tell you properly tbh.
The Singularity profile - One profile to rule them all and at HCS we bound them ;)

You see, TheThingIs, eventually you'll be allright.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2826
Re: Get a list of current profile commands or how to query voiceattack.dat?
« Reply #5 on: October 26, 2017, 07:26:27 AM »
The .dat file is a binary repository of the profiles that you are using.  The format changes with almost every release of VA, and the persistence method has changed at least four times since the project began (most recently in the last week or so).  So, although not a moving target, it is certainly an unstable target that I'm not going to be able to provide an interface to, unfortunately :(

RoyMi6

  • Guest
Re: Get a list of current profile commands or how to query voiceattack.dat?
« Reply #6 on: October 26, 2017, 09:06:25 AM »
Cheers Gary. Just as I finally remembered about serialisation of objects (which appears to be what you've done) your added info about the fact that it's likely to change means I won't bother pursuing this.

As I write this I'm thinking I'll just add in a note to the VA output that when my plugin doesn't find a match that you might need to re-export your profile for it to search.

-------------

Given that this was my last sticking point I plan on releasing this plugin soon (maybe next week) called "Voice Attack - Did You Mean" which basically does a search of your commands trying to find what you might have meant when you say an unrecognised command.

It's become invaluable to me since I started using some of the pre-compiled voicepacks as sometimes the author's choice of phrases doesn't match what I'd naturally say. While it's easy enough to update them individually these VA profiles can be huge, so I created a kind of "fuzzy search" that tries to identify the command you meant then reads suggestions back to you.

Works great if a profile contains the command "open cargo scoop" and you say "open THE cargo scoop".

If it only finds one match it will automatically run the command, if it finds more than one then it will read two or three back to you depending on how you configure it.

Watch this space! Or the plugin release section anyway :)

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2826
Re: Get a list of current profile commands or how to query voiceattack.dat?
« Reply #7 on: October 26, 2017, 09:50:58 AM »
I can see about providing a string array through vaProxy that can provide the current list of, 'when i say' values if that makes anything easier.

RoyMi6

  • Guest
Re: Get a list of current profile commands or how to query voiceattack.dat?
« Reply #8 on: October 26, 2017, 12:36:16 PM »
Gary that would be amazing!

I think really it’s the only thing missing from vaProxy.

Just as an aside, because I’m looking for speakable commands a list of “when I say” commands would be great but some others might want to know if those “when I say” phrases are “active” ones (where the checkbox is either checked or not)

Doesn’t bother me either way :)

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2826
Re: Get a list of current profile commands or how to query voiceattack.dat?
« Reply #9 on: October 26, 2017, 05:59:21 PM »
Well, I had spoken too soon.  What I'm finding in regards to the list of commands in VA is highly overloaded.  There's the spoken phrases that are typed in by the user, which can be dynamic.  They can now also contain tokens and/or wildcards.  There are also phrases that are typed in that belong to composite commands (prefix/suffix), plus any phrases that are created by the, 'listening override' feature.  All that, plus they can be enabled or disabled.  This is probably more something like, 'what can currently be spoken' than a, 'when I say' list o_O

RoyMi6

  • Guest
Re: Get a list of current profile commands or how to query voiceattack.dat?
« Reply #10 on: October 27, 2017, 02:08:03 AM »
Christ, yeah, that does get more complicated than the fairly standard profiles I'm using...

I also understand what you mean in that if you've got a command that has the "when I say" configured as:

[divert;reroute] power to [weapons;weapon systems]

then the "what can currently be spoken" list should contain:

divert power to weapons
divert power to weapon systems
reroute power to weapons
reroute power to weapon systems

I still need to test this kind of thing with my current code actually - it's something I had overlooked as I'm not actually using VA for anything that complicated at the moment.