Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CreatePhraseFromText error

18 views
Skip to first unread message

JV

unread,
Oct 2, 2012, 6:30:52 AM10/2/12
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).

seotae...@gmail.com

unread,
Apr 26, 2013, 3:12:01 AM4/26/13
to
You have not tried the CreatePhraseFromText function but how does it work?
0 new messages