1

Cortana がバックグラウンド アプリ サービスと対話するように取り組んでいます。Cortana は 1 つの音声コマンド セットで動作しますが、別のコマンド セットから音声コマンドを試してみると、Bing で検索が開かれます。

何が原因であるか、または Cortana との連携を改善するためのコマンドの変更に関する提案はありますか?

動作しないコマンド セット:

<Command Name="SetTemperatureDefault">
  <Example> change the temperature to 72 degrees </Example>
  <ListenFor RequireAppName="BeforeOrAfterPhrase"> set [the] temperature to {Temperature} degrees </ListenFor>
  <ListenFor RequireAppName="BeforeOrAfterPhrase"> change [the] temperature to {Temperature} degrees </ListenFor>
  <ListenFor RequireAppName="BeforeOrAfterPhrase"> increase [the] temperature to {Temperature} </ListenFor>
  <ListenFor RequireAppName="BeforeOrAfterPhrase"> decrease [the] temperature to {Temperature} </ListenFor>
  <ListenFor RequireAppName="BeforeOrAfterPhrase"> set to {Temperature} degrees </ListenFor>
  <ListenFor RequireAppName="BeforeOrAfterPhrase"> change to {Temperature} degrees </ListenFor>
  <ListenFor RequireAppName="BeforeOrAfterPhrase"> increase to {Temperature} degrees </ListenFor>
  <ListenFor RequireAppName="BeforeOrAfterPhrase"> decrease to {Temperature} degrees </ListenFor>
  <ListenFor RequireAppName="BeforeOrAfterPhrase"> set temp to {Temperature} degrees </ListenFor>
  <ListenFor RequireAppName="BeforeOrAfterPhrase"> change temp to {Temperature} degrees </ListenFor>
  <Feedback> Changing temperature... </Feedback>
  <VoiceCommandService Target="CozyVoiceCommandService" />
</Command>
4

1 に答える 1

1

まず、アプリの初期化中に 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);
    }
}

次に、コマンドに { Temperature } を使用しているため、 Commandをすべてリストした後でPhraseTopicを使用する必要があります。

    ...
    <Command Name="SetTemperatureDefault">
      <Example> change the temperature to 72 degrees </Example>
      <ListenFor RequireAppName="BeforeOrAfterPhrase"> set [the] temperature to {Temperature} degrees </ListenFor>
      <ListenFor RequireAppName="BeforeOrAfterPhrase"> change [the] temperature to {Temperature} degrees </ListenFor>
      <ListenFor RequireAppName="BeforeOrAfterPhrase"> increase [the] temperature to {Temperature} </ListenFor>
      <ListenFor RequireAppName="BeforeOrAfterPhrase"> decrease [the] temperature to {Temperature} </ListenFor>
      <ListenFor RequireAppName="BeforeOrAfterPhrase"> set to {Temperature} degrees </ListenFor>
      <ListenFor RequireAppName="BeforeOrAfterPhrase"> change to {Temperature} degrees </ListenFor>
      <ListenFor RequireAppName="BeforeOrAfterPhrase"> increase to {Temperature} degrees </ListenFor>
      <ListenFor RequireAppName="BeforeOrAfterPhrase"> decrease to {Temperature} degrees </ListenFor>
      <ListenFor RequireAppName="BeforeOrAfterPhrase"> set temp to {Temperature} degrees </ListenFor>
      <ListenFor RequireAppName="BeforeOrAfterPhrase"> change temp to {Temperature} degrees </ListenFor>
      <Feedback> Changing temperature... </Feedback>
      <VoiceCommandService Target="CozyVoiceCommandService" />
    </Command>

    <PhraseTopic Label="Temperature" />
  </CommandSet>
</VoiceCommands>

ここでテストしましたが、魅力的に機能します。

これは、フォアグラウンドでの Cortanaの完全なチュートリアルであり、必要な他の状況で役立つ可能性があります。

于 2015-08-14T14:25:06.477 に答える