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

LoadDictation fails

28 views
Skip to first unread message

Stéphane Lallée

unread,
May 22, 2013, 11:36:09 AM5/22/13
to
Hi !
I'm developping an application using SAPI (5.4 or Speech Platform 11. I'm still wondering about the difference...)
I can load a grammar from a file, or create a grammar at runtime. This is working fine.
Now I would like to enable dictaction and this call always fail with : -2147200966 (SPERR_NOT_FOUND)

Here is a snippet of my code:

/All this loading part goes fine
bool everythingIsFine = true;
everythingIsFine &= SUCCEEDED(this->m_cpRecoEngine.CoCreateInstance(CLSID_SpInprocRecognizer));
everythingIsFine &= SUCCEEDED( SpCreateDefaultObjectFromCategoryId(SPCAT_AUDIOIN, &m_cpAudio));
everythingIsFine &= SUCCEEDED( m_cpRecoEngine->SetInput(m_cpAudio, TRUE));
everythingIsFine &= SUCCEEDED( m_cpRecoEngine->CreateRecoContext( &m_cpRecoCtxt ));

//Create a dictation grammar
everythingIsFine &= SUCCEEDED( m_cpRecoCtxt->CreateGrammar( 0, &m_cpGrammarDictation ));
everythingIsFine &= SUCCEEDED( m_cpGrammarDictation->SetGrammarState(SPGS_DISABLED));
HRESULT hr = m_cpGrammarDictation->LoadDictation(NULL, SPLO_STATIC);
//At this point hr is always -2147200966



I'm able to do dictation with the standard windows tools and the examples of the SDK. Only in my code i'm stuck...
Thanks in advance for the help.
Stéphane Lallée
0 new messages