使用 SAPI 加载听写

发布于 2024-08-25 17:05:18 字数 356 浏览 4 评论 0原文

我可以使用听写资源工具包或此处给出的指示创建备用听写语法。我无法使用 C++ 加载新的听写主题。我正在尝试修改 sapi5.1 sdk 提供的 simpledict 示例。以下不起作用。

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

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);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

懒猫 2024-09-01 17:05:18

假设您的新听写语言模型名为“Genre”,

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

应该可以解决问题。

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

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

should do the trick.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文