我目前正在我的应用程序中进行Cortana集成,因为我正在尝试执行类似下面的操作
false
我有一个命令退出,我想对Cortana"附近注销",这不起作用,但是当我改变下面的ListenFor时,它正在工作。
<?xml version="1.0" encoding="utf-8" ?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
<CommandSet xml:lang="en-us" Name="NearbyCommandSet_en-us">
<AppName> Nearby </AppName>
<Example> Nearby sign out from the app</Example>
<Command Name="actionCommands">
<Example> sign out from the app </Example>
<ListenFor RequireAppName="BeforeOrAfterPhrase"> {destination} </ListenFor>
<Feedback> Signing Out from the app</Feedback>
<Navigate />
</Command>
<PhraseList Label="destination">
<Item>Sign Out</Item>
</PhraseList>
</CommandSet>
</VoiceCommands>
当我提到命令{destination}时,它无效。我的要求就是说&#34;附近退出&#34;
如何实现这一目标,是否可以在ListenFor中使用命令实现?
感谢。
答案 0 :(得分:1)
在您的PhraseList中,标签设置为“destination”,将其更改为“action”。此外,如果您想要一个可选术语,请使用如下方括号。
<ListenFor RequireAppName="BeforeOrAfterPhrase">{destination} [from app]</ListenFor>
如果您仍有同样的问题,请与我们联系。
编辑。如果需要,也可以尝试在同一命令中添加两条指令。
<ListenFor RequireAppName="BeforePhrase">{destination} [from app]</ListenFor>
<ListenFor RequireAppName="AfterPhrase">{destination} [from app]</ListenFor>