JV
unread,Oct 2, 2012, 6:30:52 AM10/2/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rm...@asobostudio.com
Hi,
I'm trying to use CreatePhraseFromText() helper method (to build a phrase to give to EmulateRecognition() ) but it fails. I've ran step by step debugging inside and it seems that it fails in the "hr = cpPhrase->InitFromPhrase(&Phrase);" that returns E_INVALIDARG, inside the CreatePhraseFromWordArray() helper.
Could anybody help in fixing that ? (I use the 10.5 SDK)
Here is my code :
const unsigned int maxCharsCnt = 256;
wchar_t wSpokenText[maxCharsCnt];
mbstowcs(wSpokenText, a_strSpokenText, maxCharsCnt);
ISpPhraseBuilder* pPhrase;
HRESULT hr = CreatePhraseFromText(wSpokenText, &pPhrase, m_WinLanguageID);
hr = m_cpRecognizer->EmulateRecognition(pPhrase);
and when InitFromPhrase() fails, the given SPPHRASE has rule->pNextSibling member to NULL and the cbSize doesn't match with the sizeof(Phrase).