【问题标题】:UWP Cortana without PhraseList没有 PhraseList 的 UWP Cortana
【发布时间】:2016-06-29 08:24:08
【问题描述】:

我想用 UWP 应用实现 Cortana,但我一直在寻找一种解决方案,以便在命令前缀之后询问随机内容。

我知道我可以动态生成 PhraseList,但这不是重点。这是我的实际 VCD 文件:

<?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>

有什么办法可以做到吗?

谢谢

【问题讨论】:

    标签: c# uwp cortana


    【解决方案1】:

    你也可以使用:

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

    所以你会:

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

    【讨论】:

      【解决方案2】:

      所以,我找到了解决方案:将 PhraseList 替换为 <PhraseTopic Label="randomcontent" Scenario="Dictation"> </PhraseTopic>

      感谢 Andrew Pilley 和他在这篇文章中的回答:UWP Cortana PhraseTopic

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-10-02
        • 1970-01-01
        • 2016-07-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-05-12
        相关资源
        最近更新 更多