我正在尝试将Cortana整合到我的UWP中。第一步是安装" VCD文件。以下代码段在Windows 10上运行正常,但在部署到Xbox时会导致错误。具体来说," installCommandDefinitionsFromStorageFileAsync"失败的是什么。还有另一种方法在Xbox上安装VCD吗?或者,这是一个尚未修复的错误吗?
return wap.current.installedLocation.getFileAsync("vdmvoicecommands.xml").then(function (file) {
return voiceCommandManager.installCommandDefinitionsFromStorageFileAsync(file);
}, function (er) {
console.error('error file vdmvoicecommands.xml', er);
}).then(function () {
var language = window.navigator.userLanguage || window.navigator.language;
var commandSetName = "VDM_" + language.toLowerCase();
var commansets = Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.installedCommandDefinitions;
if (commansets.hasKey(commandSetName)) {
console.log("VCD loaded !");
} else {
console.log("VCD not installed yet?");
}
}, function (ee) {
console.warn("installCommandDefinitionsFromStorageFileAsync error", ee);
});