Naveen
Naveen

Reputation: 6008

LoadDictation with SAPI

I am able to create alternate dictation grammars using the dictation resource kit or directions given here. I am not able to load the new dictation topic with c++. I am trying to modify the simpledict sample provided with the sapi5.1 sdk. The following doesn't work.

 std::wstring stemp = s2ws("grammar:dictation#Genre");  
    LPCWSTR mygrammar = stemp.c_str();
    hr = m_cpDictationGrammar->LoadDictation(mygrammar, SPLO_STATIC);

Upvotes: 0

Views: 711

Answers (1)

Eric Brown
Eric Brown

Reputation: 13932

Assuming your new dictation language model is named "Genre",

hr = m_cpDictationGrammar->LoadDictation(L"Genre", SPLO_STATIC);

should do the trick.

Upvotes: 1

Related Questions