问题
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