Search code examples
win-universal-appspeech-synthesiscortana

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


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.


Solution

  • 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.