Hi, i am trying to get phrase when user pronounce wrong command or phrase. i used the following code. hr = pRecoResult->GetPhrase(&pCoMemPhrase); if(SUCCEEDED(hr)) { hr = pRecoResult->GetAlternates(pCoMemPhrase->Rule.ulFirstElement, //SPPR_ALL_ELEMENTS, pCoMemPhrase->Rule.ulCountOfElements, MY_MAX_ALTERNATES, pcpPhraseAlt, &ulCount); if(SUCCEEDED(hr)) { for (int i = 0; i < ulCount; i++) hr = pcpPhraseAlt[i]->GetText(SP_GETWHOLEPHRASE, SP_GETWHOLEPHRASE, TRUE, &dstrText, NULL); } hr=pRecoResult->GetText(SP_GETWHOLEPHRASE, SP_GETWHOLEPHRASE, TRUE, &dstrText, NULL); } In the above code, ulCount always either O or Some Junk number. when "hr" value is INVALID_ARG, ulCount is Junk value. when hr value is "S_FALSE" , ulCount value is 0. pcpPhraseAlt is always null. But hr=pRecoResult->GetText(SP_GETWHOLEPHRASE, SP_GETWHOLEPHRASE, TRUE, &dstrText, NULL); line of code gives either NULL value or some text. eg: when i say "File", it gives NULL, When i say "File Open", it gives "File Properties" which is phrase in our grammer. but we need to get the text whatever the user pronounces. if he says "File Open", i should get "File Open" only. could some one who is familiar on this Please suggest me, what is wrong with this? Thanks, Bhaskar.
|