如何让Cortana使用我新的或更新的语音命令定义文件?

How can I get Cortana to use my new or updated Voice Command Definition files?

本文关键字:更新 语音 定义 文件 命令 Cortana      更新时间:2023-09-26

我使用以下代码将我的VCD文件("grammar")安装到Cortana中:

Windows.ApplicationModel.Package.current.installedLocation.getFileAsync("VoiceCommandDefinitions.xml")
.then(Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.installCommandDefinitionsFromStorageFileAsync)
.then(() => Debug.writeln("Successfully installed VCD file");

报告成功,但是当我在Cortana中写入查询时,我对VCD文件所做的更改没有反映在Cortana中。

我怎样才能强迫Cortana实际使用我更新的语法?

Cortana只会在voice交互结束时刷新语法缓存。单击Cortana的麦克风按钮,然后立即关闭Cortana框。你应该会在几秒钟内看到你的语法变化。

已安装的语法存储在%LOCALAPPDATA%'Packages'Microsoft.Windows.Cortana_cw5n1h2txyewy'LocalState'Grammars'VoiceCommands.Components.0409.cfg下。实时(即缓存)语法存储在%LOCALAPPDATA%'Packages'Microsoft.Windows.Cortana_cw5n1h2txyewy'LocalState'Grammars'ReadOnlyGrammars'VoiceCommands.Components.0409.cfg下。每当用户完成与Cortana的语音交互时,此副本都会刷新。

(没有来源,抱歉。这个信息是基于我与微软Cortana开发人员的电子邮件交流。