Jump to content

Skyrim Voice Command Engine: Seeking one committed partner.


irswat

Recommended Posts

I'm working on a voice command engine for skyrim. It is coming along very rapidly, and so far seems to be working better than expected. Right now the engine is able to parse, recognize, and execute weapon equip commands, as well as potion commands. The papyrus engine dumps these commands from a text file.

The text file will be generated by windows speech recognition software in conjunction with an as of yet undeveloped program which will simply ensure the text file autosaves, and is formatted correctly for the engines usage. I plan on writing this program in C++. In short to start skyrim with voice command engine you will open this c++ program which will simultaneously initialize the text file, open windows speech recognition, and then launch SKSE. While the program is running the applet will detect when players release the 'mic' button, it will then quickly append literal carriage returns after the voice command delimiter ("QUICK"), start a new line, save the file, wait for the file to be read by the papyrus script, and then reset the output file for the next command. Pretty simple really.

I'm searching for one person who is willing and able to help me finish developing this engine, and once release hits, to help work out bugs, and continue support for at least 6 months. I'd be especially interested in someone who has experience with multi threading papyrus scripts. I've been toying with several efficiency and performance methods in the code, but I think multi threading the code will take the engine to the next level as far as responsiveness is concerned. I work, and goto school full time but am committed to this project enough to dedicate at least 20 hours a week to development. If you are a capable scripter and programmer in a language other than Papyrus, and know your way around the CK, then send me a PM.





Link to comment
Share on other sites

Here is an example of one of the time consuming tasks that I could use help with:

 

 

WeaponNames=new string[10]

WeaponNames[1]="Woe"
WeaponNames[2]="Nightingale"
WeaponNames[3]="Miraak"
WeaponNames[4]="Magnus"
WeaponNames[5]="of"
WeaponNames[6]Aegusvabe
WeaponNames[7]Alessandra's
WeaponNames[8]Alteration
WeaponNames[9]Amren's
WeaponNames[10]Ancient
WeaponNames[11]Angi's
WeaponNames[12]Animus
WeaponNames[13]Annihilating
WeaponNames[14]Arcing
WeaponNames[15]Balckbow
WeaponNames[16]Balgruuf's
WeaponNames[17]Banishing
WeaponNames[18]Barvir's
WeaponNames[19]Binding
WeaponNames[20]Blackblade
WeaponNames[21]Blaze
WeaponNames[22]Blessed
WeaponNames[23]Blizzards
WeaponNames[24]Bloodthorn
WeaponNames[25]Bolar's
WeaponNames[26]Bound
WeaponNames[27]Briarheart
WeaponNames[28]Broken
WeaponNames[29]Burning
WeaponNames[30]Burning
WeaponNames[31]Ceremonial
WeaponNames[32]Charming
WeaponNames[33]Chillrend
WeaponNames[34]Chills
WeaponNames[35]Cold
WeaponNames[36]Conjuration
WeaponNames[37]Cowardice
WeaponNames[38]Damnation
WeaponNames[39]Dawnbreaker
WeaponNames[40]Debilitation
WeaponNames[41]Debilitation
WeaponNames[42]Depleting
WeaponNames[43]Despair
WeaponNames[44]Destruction
WeaponNames[45]Devouring
WeaponNames[46]Diminishing
WeaponNames[47]Dismay
WeaponNames[48]Dragon
WeaponNames[49]Dragonbane
WeaponNames[50]Drainblood
WeaponNames[51]Drainheart
WeaponNames[52]Draining
WeaponNames[53]Drainspell
WeaponNames[54]Dravin's
WeaponNames[55]Dread
WeaponNames[56]Eduj
WeaponNames[57]Embers
WeaponNames[58]End
WeaponNames[59]Enervating
WeaponNames[60]Evoking
WeaponNames[61]Exhaustion
WeaponNames[62]Expelling
WeaponNames[63]Eye
WeaponNames[64]Fatigue
WeaponNames[65]Fear
WeaponNames[66]Firiniel's
WeaponNames[67]Flames
WeaponNames[68]Freezing
WeaponNames[69]Froki's
WeaponNames[70]Frost
WeaponNames[71]Gadnor's
WeaponNames[72]Garnering
WeaponNames[73]Gauldor
WeaponNames[74]Geis
WeaponNames[75]Ghorbash's
WeaponNames[76]Ghostblade
WeaponNames[77]Gleaning
WeaponNames[78]Harrowing
WeaponNames[79]Harvesting
WeaponNames[80]Hunt
WeaponNames[81]Hunting
WeaponNames[82]Ice
WeaponNames[83]Immobilizing
WeaponNames[84]Inferno
WeaponNames[85]Leeching
WeaponNames[86]Lethargy
WeaponNames[87]Lightning
WeaponNames[88]Malediction
WeaponNames[89]Melka
WeaponNames[90]Nullifying
WeaponNames[91]Oathblade
WeaponNames[92]Petrifying
WeaponNames[93]Priest
WeaponNames[94]Reaping
WeaponNames[95]Reverent
WeaponNames[96]Sacrifice
WeaponNames[97]Sanctified
WeaponNames[98]Sapping
WeaponNames[99]Scorching
WeaponNames[100]Shocks
WeaponNames[101]Siphoning
WeaponNames[102]Sorcerer
WeaponNames[103]Soul Snares
WeaponNames[104]Souls
WeaponNames[105]Sparks
WeaponNames[106]Sphere
WeaponNames[107]Storms
WeaponNames[108]Subsuming
WeaponNames[109]Sunning
WeaponNames[110]Supple
WeaponNames[111]Terror
WeaponNames[112]the
WeaponNames[113]Thunderbolts
WeaponNames[114]Torpor
WeaponNames[115]Vampire
WeaponNames[116]Weariness
WeaponNames[117]Winnowing
WeaponNames[118]Winter

 

 

Link to comment
Share on other sites

equip weapons + equip hand, equip armor, use potions + numbers of potions, and now shouts, are all working. I'm still looking for help with this. I especially could use help with the C++ helper program, as well as optimizing and multi-threading my code. The requirements of the helper app are simple enough that I could write it.

Voice command engine for skyrim? anyone?

Link to comment
Share on other sites

I ran into a significant obstacle this evening. I hope someone is able to lend some expertise.

So I'm writing a text parsing engine for skyrim, and it's coming along very nicely. I'm about 2000 lines deep and it includes support for all vanilla+dlc shouts, a ton of weapons, armor, and potions. It is very easy to add support for new content.

The plan was use microsoft voice to speech in the background with notepad to output a text file. A lightweight c++ applet would run along side to format the textfile when the mic button is pressed/released, save the text file, then delete it about a second later. The parsing engine dumps that text file to a string and does all sorts of neat things. The problem is that microsoft voice recognition does not stay focused on notepad when skyrim is open, even in windowed mode. I've considered several options, but as of right now with no one expressing interest in helping me develop this I am at a loss. I'd hate to see this really cool parsing engine go to waste, so the second I can find someone willing to help me develop a solution that makes it possible to dictate speech to text while in game, I'll be ready to get back into development full steam.

I've thought about experimenting with the cmu sphinx libraries, but again I go to school full time and work, and I really don't have it in me to try to learn a new programming language.

If anyone wants to take a gander at the source code I'm working on, let me know. If you can help leave a message or pm me.

Edited by irswat
Link to comment
Share on other sites

if anything and regardless of which speech library you use, trying to dictate into notepad and use that as input for your program doesn't really seem like a robust solution. i'd think that you'd want whatever you're working on to accept voice commands as input just as your basic starting point. you don't need to learn a new language, because there's a library for c++ that has a whole 8 functions that would work fine. http://voce.sourceforge.net/

Edited by ymf331
Link to comment
Share on other sites

The method you are proposing is highly inefficient and prone to many problems. This is better done as an SKSE plugin instead of an external program without any need to save to text files and such.

 

You can register event handlers so that events from an SKSE plugin can call directly into Papyrus code. Take a look at the SKSE source code for how OnKeyDown is performed for example:

 

https://github.com/xanderdunn/skaar/blob/b20ff15c9bf9a5cdcfecdfd5bf9b70db5e7e56ab/skaar_skse_plugin/skse/PapyrusEvents.cpp#L180

 

You should be able to use the Windows Speech API to pass the strings produced from the speech-to-text directly to Papyrus using this method in a much simpler and efficient manner and you don't have to worry about complex threading issues as everything is event based.

 

Sorry to say I can't help you with your project, but it will make a big difference if you take some time understanding the SKSE code in order to develop an event based plugin to do what you require.

Link to comment
Share on other sites

Very useful I formation.I knew nothing about the skse plugin capabilities. So it sounds like I can register for a key release in papyrus then when detected call a function compiled into an skse library that returns a string from speech recognition api? Very cool

Maybe ill write the parser in c++ compiled it into a skse library and only use papyrus to execute commands.

 

Thanks much guys. Very helpful.

Link to comment
Share on other sites

#include "MyPlugin.h"
#include "sapi.h"

namespace MyPluginNamespace {
	// Declare local identifiers:
	HRESULT                   hr = S_OK;
	CComPtr<ISpRecoResult>    cpRecoResult;
	SPPHRASE                  *pPhrase;
	WCHAR                     *pwszText;

	// ... Obtain a recognition result object from the recognizer ...

	// Get the recognized phrase object.
	hr = cpRecoResult->GetPhrase(&pPhrase;);

	if (SUCCEEDED(hr))
	{
		// Get the phrase's entire text string, including replacements.
		hr = cpRecoResult->GetText(SP_GETWHOLEPHRASE, SP_GETWHOLEPHRASE, TRUE, &pwszText; , NULL);
	}

	if (SUCCEEDED(hr))
	{
		// Get the phrase's first 2 words, excluding replacements.
		hr = cpRecoResult->GetText(pPhrase->Rule.ulFirstElement, 2, FALSE, &pwszText; , NULL);
	}

	if (SUCCEEDED(hr))
	{
		return cpRecoResult;
	}
}

	bool RegisterFuncs(VMClassRegistry* registry) {
		registry->RegisterFunction(
			new NativeFunction0 <StaticFunctionTag, float>("MyTest", "MyPluginScript", MyPluginNamespace::MyTest, registry));

		return true;
	}
} 

I tried making an SKSE plugin using SAPI 5.4 sample code and it just won't compile. It's been like 13 years since I've done anything in C++, and even then it as just high school AP C++ stuff.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...