【问题标题】:Cortana Application and Voice Commands not showing or working from CortanaCortana 应用程序和语音命令未在 Cortana 中显示或工作
【发布时间】:2015-08-04 12:18:08
【问题描述】:

输入“我能说什么?”时,Cortana 中不显示应用程序和语音命令

我正在尝试通过 Cortana 在前台使用语音命令并运行 Cortana 语音命令示例,但无法让 Cortana 显示应用程序或打开/执行名为“AdventureWorks”的应用程序的语音命令。

我正在使用 Cortana 语音命令示例,我在调试中在 Windows 10 上本地从 Visual Studio 2015 运行。根据此链接,这应该在我的本地计算机上创建示例的解包版本,我应该能够从“开始”屏幕中看到我无法看到的版本。 我已经在应用程序的功能下激活了麦克风,并包含了 en-GB resources.resw 文件,并将 Package.appxmanifest 更改为 en-GB 的默认语言以匹配以尝试确保 Cortana 的语言与应用程序匹配以消除这是一个潜在的问题。

以下链接显示在从 VS 运行应用程序后(无论是否调试),应用程序的未打包版本应该在“开始”屏幕中可见: How to deploy a Metro App to the Desktop?

Cortana 语音命令示例: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CortanaVoiceCommand

注意: 除了我之外,该应用程序是标准的,包括 en-GB 资源文件,将 package.appxmanifest 位置更改为 en-GB 并将麦克风添加到应用程序的功能中。我的电脑上也启用了开发者模式。

更新:将 vcd.xml 添加到 VoiceCommandDefinitionManager 时没有发生异常。看起来它应该可以工作。 我还注意到,在运行示例时,我看不到伦敦的图片或在此视频中显示“正在听”的麦克风图标:https://channel9.msdn.com/Events/Build/2015/3-716 at 04:16

此时谷歌搜索“应用程序未在 Cortana 中显示”没有显示任何有用的结果。

有没有其他人幸运地让这个样本工作?或类似的问题?你还在用英文版吗?

任何帮助或想法将不胜感激

【问题讨论】:

  • 奇怪的是,通过这个单独的示例也没有在 Cortana 中显示我的应用程序或命令:msdn.microsoft.com/en-us/library/dn630430.aspx
  • 您的语言和地区设置都设置为 en-GB 了吗?
  • 有同样的问题。只是简单的示例解决方案,没有任何编辑....您发现问题所在了吗?

标签: c# cortana


【解决方案1】:

我已使用 en-US 成功测试了AdverntureWorks 示例。 我还开发了另一个关于 Cortana 前景的 sample

基本上我已经创建了 VCD,然后安装了它:

protected async override void OnLaunched(LaunchActivatedEventArgs e)
{
    ...
    // Install the VCD
    try
    {
        StorageFile vcdStorageFile = await Package.Current.InstalledLocation.GetFileAsync(@"HomeControlCommands.xml");
        await VoiceCommandDefinitionManager.InstallCommandDefinitionsFromStorageFileAsync(vcdStorageFile);
    }
    catch (Exception ex)
    {
        System.Diagnostics.Debug.WriteLine("There was an error registering the Voice Command Definitions", ex);
    }
}

然后处理激活:

protected override void OnActivated(IActivatedEventArgs e)
{
    // Handle when app is launched by Cortana
    if (e.Kind == ActivationKind.VoiceCommand)
    {
        VoiceCommandActivatedEventArgs commandArgs = e as VoiceCommandActivatedEventArgs;
        SpeechRecognitionResult speechRecognitionResult = commandArgs.Result;

        string voiceCommandName = speechRecognitionResult.RulePath[0];
        string textSpoken = speechRecognitionResult.Text;
        IReadOnlyList<string> recognizedVoiceCommandPhrases;

        System.Diagnostics.Debug.WriteLine("voiceCommandName: " + voiceCommandName);
        System.Diagnostics.Debug.WriteLine("textSpoken: " + textSpoken);

        switch (voiceCommandName)
        {
        ...
        }
    }
}

详细过程描述here

【讨论】:

    【解决方案2】:

    我遇到了完全相同的问题。

    确保您为Package.appxmanifest 开启了麦克风功能,否则它不起作用。

    请打开它,在解决方案资源管理器中选择您的Package.appxmanifest 转到Capabilities 并检查Microphone

    更多信息:http://jamescroft.co.uk/blog/universal-windows-8-dev/how-to-get-your-apps-cortana-ready/

    希望这会有所帮助, 水坝

    【讨论】:

      【解决方案3】:

      我遇到了和你一样的问题,正如 DevEnitly 所指出的那样,如果你的地区设置为英国,并且在你的 VCD 文件中你的 CommandSet 的语言是 en-US 它将不起作用,只需更改 CommandSet 的语言对于 us-gb(或适合您所在地区的任何语言)应该可以解决问题(它对我有用),还请注意,如果您想支持不同的语言,您应该添加更多命令集。希望这能解决您的问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-02-24
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多