Speech recognition 用SAPI进行负荷听写

Speech recognition 用SAPI进行负荷听写,speech-recognition,sapi,Speech Recognition,Sapi,我能够使用听写资源工具包或给出的说明创建备用听写语法。我不能用C++来装载新的听写题目。我正在尝试修改随sapi5.1 sdk提供的simpledict示例。下面的方法不起作用 std::wstring stemp = s2ws("grammar:dictation#Genre"); LPCWSTR mygrammar = stemp.c_str(); hr = m_cpDictationGrammar->LoadDictation(mygrammar, SPLO_STATI

我能够使用听写资源工具包或给出的说明创建备用听写语法。我不能用C++来装载新的听写题目。我正在尝试修改随sapi5.1 sdk提供的simpledict示例。下面的方法不起作用

std::wstring stemp = s2ws("grammar:dictation#Genre"); LPCWSTR mygrammar = stemp.c_str(); hr = m_cpDictationGrammar->LoadDictation(mygrammar, SPLO_STATIC); std::wstring stemp=s2ws(“语法:听写体裁”); LPCWSTR mygrammar=stemp.c_str();
hr=m_cpDictationGrammar->LoadDictation(mygrammar,SPLO_STATIC) 假设您的新听写语言模型名为“体裁”


应该可以了。

谢谢,它很管用。我的另一个问题是我忘记了我已经用我的“流派”语言模型重命名了目录。像往常一样,人为错误。
hr = m_cpDictationGrammar->LoadDictation(L"Genre", SPLO_STATIC);