简体   繁体   中英

UWP Cortana without PhraseList

I want to implement Cortana with a UWP app, and I'm stuck to find a solution for asking a random content after the Command Prefix.

I know I could generate PhraseList dynamically, but, that's not the point here. Here is my actual VCD file:

<?xml version="1.0" encoding="utf-8" ?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
<CommandSet xml:lang="fr" Name="MyAppCommand_fr">
<CommandPrefix>MyApp</CommandPrefix>

<Command Name="showContent">

  <ListenFor RequireAppName="BeforePhrase">{randomcontent}</ListenFor>
  <Feedback>Searching for {randomcontent}</Feedback>
  <Navigate />
</Command>

<!-- What I want here, is to get rid of PhraseList -->
<PhraseList Label="randomcontent">
  <Item>Random Content</Item>
</PhraseList>

</CommandSet>
</VoiceCommands>

Is there any way to accomplish that ?

Thanks

you can also use:

 <PhraseTopic Label="searchParam" Scenario="Search"/>

so you would have:

<Command Name="showContent">    
  <ListenFor RequireAppName="BeforePhrase">{randomcontent}</ListenFor>
  <Feedback>Searching for {randomcontent}</Feedback>
  <Navigate />
</Command>

<PhraseList Label="randomcontent" Scenario="Search"/>

So, I found the solution: Replace the PhraseList with <PhraseTopic Label="randomcontent" Scenario="Dictation"> </PhraseTopic>

Thanks for Andrew Pilley and his answer in this post: UWP Cortana PhraseTopic

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM