Rather than repeat my blog post, here is the link to the original one:
http://software.intel.com/en-us/blogs/2013/03/17/ultimate-coder-challenge-ii-lee-going-perceptual-week-five
And my video for this week:
And There's More
After I posted the blog I solved the Voice Control problem. Here is the code and solution - hurray!
First you set up your grammar:
// Grammar intialization
pxcUID gid;
pmyVS->vc->CreateGrammar(&gid);
pmyVS->vc->AddGrammar(gid,1,L"Host");
pmyVS->vc->AddGrammar(gid,2,L"Call");
pmyVS->vc->AddGrammar(gid,3,L"Exit");
pmyVS->vc->AddGrammar(gid,4,L"Conference");
pmyVS->vc->AddGrammar(gid,5,L"Rick");
pmyVS->vc->AddGrammar(gid,6,L"Lee");
pmyVS->vc->AddGrammar(gid,7,L"Toggle");
pmyVS->vc->AddGrammar(gid,8,L"Import");
pmyVS->vc->AddGrammar(gid,9,L"Magnificent");
pmyVS->vc->AddGrammar(gid,10,L"Ploppy");
pmyVS->vc->AddGrammar(gid,11,L"Horse");
pmyVS->vc->AddGrammar(gid,12,L"Dog");
pmyVS->vc->AddGrammar(gid,13,L"Lion");
pmyVS->vc->AddGrammar(gid,14,L"Wolf");
pmyVS->vc->SetGrammar(gid);
And then you look for the respective value in the callback function:
gLatestVoiceCommand = -1;
int labelvalue = cmd->label;
if ( labelvalue > 0 )
{
gLatestVoiceCommand = labelvalue;
}
Presto, a VERY fast voice recognition system! When realisation dawned, I kicked myself, then wanted to tell someone, so I am telling my blog :)
Signing Off
Decided to break my challenge tradition and do some Ultimate Coding during the week to get a good demo for GDC ready. The size of another project on my plate shrinks this week so I should have some quality time :)
I would be sorely tempted to adapt what I have to use a fully 3D avatar, but there is precious little time left in the competition. I can always expand my V1 app to include a fully synthetic avatar for users with very high latency, poor connection or extreme shyness :)
ReplyDelete