首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Cortana RequestDisambiguationAsync误差

Cortana RequestDisambiguationAsync误差
EN

Stack Overflow用户
提问于 2015-08-12 01:40:20
回答 1查看 176关注 0票数 1

我正试图通过Cortana为我的应用程序工作,让用户与后台应用程序进行交互。

每当我做RequestDisambiguationAsync(response)时,Cortana就说它遇到了一个错误。但是,它并没有破坏Visual中的任何地方。

对是什么原因有什么想法吗?下面是我正在使用的代码:

代码语言:javascript
复制
var userPrompt = new VoiceCommandUserMessage();
string home1 = data.Structures[0].Name;
string home2 = data.Structures[1].Name;
userPrompt.DisplayMessage = "Which one did you want to set to home?";
userPrompt.SpokenMessage = String.Format("Which one did you want to set to home? {0} or {1}?", home1, home2);

var userReprompt = new VoiceCommandUserMessage();
userReprompt.DisplayMessage = "Which one did you want to set to home?";
userReprompt.SpokenMessage = "Which one did you want to set to home?";

var structuresContentTiles = new List<VoiceCommandContentTile>();

var structureTile = new VoiceCommandContentTile();
structureTile.ContentTileType = VoiceCommandContentTileType.TitleWith68x68IconAndText;
structureTile.Title = home1;
structureTile.AppContext = data.Structures[0].Structure_id;
structuresContentTiles.Add(structureTile);

var structureTile2 = new VoiceCommandContentTile();
structureTile2.ContentTileType = VoiceCommandContentTileType.TitleWith68x68IconAndText;
structureTile2.Title = home2;
structureTile.AppContext = data.Structures[1].Structure_id;
structuresContentTiles.Add(structureTile2);

var response = VoiceCommandResponse.CreateResponseForPrompt(userPrompt, userReprompt, structuresContentTiles);

var voiceCommandDisambiguationResult = await voiceServiceConnection.RequestDisambiguationAsync(response);
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-08-12 18:08:23

在某些情况下,当您使用

代码语言:javascript
复制
structureTile.ContentTileType = VoiceCommandContentTileType.TitleWith68x68IconAndText;

但不要提供图像。将其更改为VoiceCommandContentTileType.TitleOnly,或者如果您正在提供一个Line1,使用VoiceCommandContentTileType.TitleWithText或提供一个映像,这将阻止故障的发生。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31954679

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档