How to fetch the text spoken to cortana while the SpeechRecognitionResult.Text is returning “…” - Windows UWP

时间秒杀一切 提交于 2019-12-13 00:48:56

问题


While deep linking Windows UWP apps with cortana, I'm unable to fetch the text spoken. In the Voice Command Definition file I'm using a <ListenFor> element with {*} in order to allow user to speak anything, but I'm unable to fetch it.


回答1:


If you're trying to set up a VCD to accept freeform dictated text, you'll need to use a PhraseTopic field. See the 1.2 VCD spec for details.

For example, if you've got a Command block containing

<ListenFor> Take a note to {noteTopic} </ListenFor>

You'd want a corresponding PhraseTopic

<PhraseTopic Label="noteTopic" Scenario="Dictation">
</PhraseTopic>

There's various options (Subjects and Scenarios) you can use to refine the dictation service's behavior.




回答2:


You could also use Scenario="Search" and have you VCD look something like this:

<ListenFor> Take a note to {noteTopic} </ListenFor>
<PhraseTopic Label="noteTopic" Scenario="Search"/>


来源:https://stackoverflow.com/questions/34608991/how-to-fetch-the-text-spoken-to-cortana-while-the-speechrecognitionresult-text-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!