开发者

LoadDictation with SAPI

开发者 https://www.devze.com 2022-12-23 16:40 出处:网络
I 开发者_Go百科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

I 开发者_Go百科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);


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

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

should do the trick.

0

精彩评论

暂无评论...
验证码 换一张
取 消