Я регистрирую следующий файл VCD.xml в моем универсальном приложении C# Windows 10, но я не могу заставить Cortana отвечать на них, он просто ищет Bing каждый раз.Зарегистрированный файл управления голосовым управлением, похоже, не работает
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
<CommandSet xml:lang="en-us" Name="UniversalAppCommandSet_en-us">
<AppName> Spang </AppName>
<Example> Tell me the time </Example>
<Command Name="TellTime">
<Example> tell me the time </Example>
<ListenFor RequireAppName="BeforeOrAfterPhrase"> tell me the time </ListenFor>
<Feedback> Getting the time for you. </Feedback>
<Navigate/>
</Command>
</CommandSet>
</VoiceCommands>
Я регистрируюсь в OnLaunched в соответствии с указаниями Microsoft.
try
{
// Install the main VCD.
StorageFile pSFeVCD = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/VCD.xml"));
await Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.InstallCommandDefinitionsFromStorageFileAsync(pSFeVCD);
System.Diagnostics.Debug.WriteLine("Successfully installed voice commands.");
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("Installing Voice Commands Failed: " + ex.ToString());
}
Я пытаюсь говорить и печатать команду, но не повезло. Он мгновенно выполняет поиск Bing без паузы.
Ник.