我想使用新的Cortana引擎在Windows 10上开发Windows应用程序.
不幸的是,据我所知,它似乎仅在Windows Phone 8.1项目中可用(例如,我没有找到从不同类型的Visual Studio项目访问Windows.Media.SpeechRecognition命名空间的方法).
此外,我无法找到一个好的API文档,只有一些非常简单的例子.
编辑:
根据Peter Torr的回答,我写了一些代码.我已经能够识别出一些词,但是当它试图识别一些像"你好"这样简单的词时,引擎似乎很挣扎,而Cortana成功识别它.
难道我做错了什么?
public static class SpeechSynthetizerManager
{
private static readonly SpeechSynthesizer synth = new SpeechSynthesizer();
private static readonly SpeechRecognitionEngine speechRecognitionEngine = new SpeechRecognitionEngine();
public static event EventHandler<SpeechRecognizedEventArgs> SpeechRecognized
{
add { speechRecognitionEngine.SpeechRecognized += value; }
remove { speechRecognitionEngine.SpeechRecognized -= value; }
}
public static event EventHandler<RecognizeCompletedEventArgs> RecognizeCompleted
{
add { speechRecognitionEngine.RecognizeCompleted += value; }
remove { speechRecognitionEngine.RecognizeCompleted -= value; }
}
static SpeechSynthetizerManager()
{
synth.SelectVoiceByHints(VoiceGender.Female);
speechRecognitionEngine.LoadGrammar(new DictationGrammar());
speechRecognitionEngine.SetInputToDefaultAudioDevice();
}
public static …Run Code Online (Sandbox Code Playgroud) 我在Azure DevOps上有一个项目,其中包含相同主存储库的多个分支。我为该存储库创建了一个构建管道,不幸的是,由于只能为单个存储库配置管道,因此无法在当前的fork中重复使用。
该解决方案并不理想,因为会导致多个相同的管道,每个分支一个,并且很难维护所有管道。
有没有一种方法可以将一个管道用于多个存储库?
我正在使用AutoMapper。
我在映射集合时遇到了一些问题。这是简化的结构。
public class A
{
}
public class B : A
{
}
public class C : A
{
}
public class Origin
{
public List<A> Entities {get; set;}
}
/********************/
public class A2
{
}
public class B2 : A2
{
}
public class C2 : A2
{
}
public class Destination
{
public List<A2> Entities {get; set;}
}
Run Code Online (Sandbox Code Playgroud)
Origin 类具有 A 对象的集合,其中填充了 A、B 或 C 实例。
我想将 Origin 映射到 Destination,所以我添加了这个配置:
Mapper.CreateMap<C, C2>();
Mapper.CreateMap<B, B2>();
Mapper.CreateMap<A, …Run Code Online (Sandbox Code Playgroud) 也许我错过了一些东西,但我无法弄清楚如何从点击回调中调用Listviewclass的方法之一.
这是代码:
function Listview(el, cb) {
this.element = el;
this.callback = cb;
this.select = function (element, index) {
...
};
this.selectElement = function (element) {
...
};
this.unselectCurrentElement = function () {
...
};
this.element.find('li').click(function () {
// Here I want to call for example the selectElement method
// but how?
// The This keyword reference the "li" element
});
this.element.addClass("Listview");
this.select(this.element, 0);
};
Run Code Online (Sandbox Code Playgroud) c# ×2
automapper ×1
azure-devops ×1
cortana ×1
inheritance ×1
javascript ×1
jquery ×1
object ×1
windows-10 ×1