我正试图将Cortana融入我的UWP。第一步是“安装”VCD文件。下面的代码片段在Windows 10上运行良好,但在部署到Xbox时会导致错误。具体来说,"installCommandDefinitionsFromStorageFileAsync“是失败的原因。还有其他方法在Xbox上安装VCD吗?或者,这是一个尚未修复的bug吗?
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);
});发布于 2016-06-16 21:39:39
Xbox目前不支持VoiceCommands API。您可以找到Xbox 这里目前不支持的UWP API列表。
https://stackoverflow.com/questions/37817468
复制相似问题