Tag: sapi

SpeechRecognitionEngine识别器

我刚刚下载了fr-FR运行时语言包,以便通过我的程序识别法语语音。 但是,我的程序抛出了错误 附加信息:找不到所需ID的识别器。 在 SpeechRecognitionEngine recognizer = new SpeechRecognitionEngine(new System.Globalization.CultureInfo(“fr-FR”)); en-US和en-GB之所以有效,是因为它们已经预先安装了我的系统,我只是安装了这些新的语言包,但它们仍然会抛出这个exception。 此外,如果这有帮助,当我这样做 foreach (var x in SpeechRecognitionEngine.InstalledRecognizers()) { Console.Out.WriteLine(x.Name); } 它打印 MS-1033至1080年,DESK 编辑:这不是一个可能的重复,因为这不是没有安装识别器,它是关于C#SAPI没有看到我有当前语言的已安装包

如何使用C#在SAPI 5.4的听写中获得备用单个单词?

我正在进行语音识别和新技术的用户研究。 在实验室测试期间,我需要使用我编程的界面显示所有口述的文本。 目前,我可以在C#中获得备用整句,但我需要得到单个单词。 例如,如果有人说“你好,我的名字是安德鲁”,我想得到“你好”,“我的”,“名字”,“是”和“安德鲁”的替代词,而不是完整的替代词。句子。 这是我正在使用的处理程序的代码片段。 public void OnSpeechRecognition(int StreamNumber, object StreamPosition, SpeechRecognitionType RecognitionType, ISpeechRecoResult Result) { int NUM_OF_ALTERNATES = 5; // Number of alternates sentences to be read string recognizedSentence = Result.PhraseInfo.GetText(0, -1, true); // Get alternate sentences ISpeechPhraseAlternates phraseAlternates = Result.Alternates(NUM_OF_ALTERNATES); } 任何想法都表示赞赏。

.Net Speech.Synthesizer中的内存泄漏?

我在申请中发现了连续泄漏。 在使用内存分析器进行检查后,我发现该课程是来自Microsoft Speech.Synthesizer的一些对象 所以我建立了一个玩具项目来validation这个假设: //在Speech.Synthesizer对象中显示内存泄漏的玩具示例 static void Main(string[] args) { string text = “hello world. This is a long sentence”; PromptBuilder pb = new PromptBuilder(); pb.StartStyle(new PromptStyle(PromptRate.ExtraFast)); pb.AppendText(text); pb.EndStyle(); SpeechSynthesizer tts = new SpeechSynthesizer(); while (true) { //SpeechSynthesizer tts = new SpeechSynthesizer(); Console.WriteLine(“Speaking…”); tts.Speak(pb); //Print private working set sieze Console.WriteLine(“Memory: {0} KB\n”, (Process.GetCurrentProcess().PrivateMemorySize64 / 1024).ToString(“0”)); […]

C#SAPI 5.4语言?

我已经制作了一个使用SAPI 5.4识别语音的简单程序,我想问一下我是否可以为TTS和ASR添加更多语言,谢谢以下代码我让你任何人都需要看看它 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using SpeechLib; using System.Globalization; using System.Speech.Recognition; namespace WindowsFormsApplication1 { public partial class Form1 : Form { // Speech Recognition Object SpSharedRecoContext listener; // Grammar object ISpeechRecoGrammar grammar; public Form1() { InitializeComponent(); } public string ps; private void […]

SAPI或(文本到语音)的同步问题… C#

我正在开发一个能说出浏览网页内容的项目。浏览器由我使用WebControl制作。 我正在使用SAPI语音引擎。 我想在通过SpVoice.speak阅读时突出显示网页中的行。 但问题是如果我以异步方式使用这种说话方法,那么只有网页的最后一行会突出显示,因为循环不会等待语音完成。 因此它发生得如此之快,以至于只有最后一行显示为高亮显示.Highlight方法使用引用Microsoft mshtml。 码: SpeechLib.SpVoice sound_object = new SpeechLib.SpVoice(); bool highlight(string senten) { if (senten != null) { IHTMLDocument2 doc = (IHTMLDocument2)GetCurrentBrowser().Document.DomDocument; IHTMLSelectionObject sel = (IHTMLSelectionObject)doc.selection; IHTMLTxtRange rng = (IHTMLTxtRange)sel.createRange(); rng.collapse(false); if (rng.findText(senten, 1000000, 0)) { rng.select(); return true; } else { return false; } } else { return false; } } […]

SpVoice和SpeechSynthesizer有什么区别

使用语音API或SAPI在C#中这两种方法有什么区别? using SpeechLib; SpVoice speech = new SpVoice(); speech.Speak(text, SpeechVoiceSpeakFlags.SVSFlagsAsync); 返回Apacela的声音 ,和 SpeechSynthesizer ss = new SpeechSynthesizer(); ss.SpeakAsync (“Hello, world”); 不适用于Apacela的声音 。 第一个声音返回所有声音但第二个声音只返回少量声音。 这是与SAPI 5.1和SAPI 5.3相关的吗? 在Vista和XP上的行为是相同的,在SpVoice能够检测到Apacela语音但是使用SpeechSynthesizer时,在XP和Vista上都没有检测到声音。 我猜XP使用SAPI 5.1,而Vista使用SAPI 5.3然后为什么在所有操作系统上都有相同的行为,但是与API的行为不同? 另外哪个API更强大,两种方式/ API之间有什么区别?

如何使用Microsoft SAPI将文本到语音保存为wav?

我需要将文本转换为语音,然后将其保存为wav文件。

如何在C#中将语法(规则)和听写(言论自由)与SpeechRecognizer混合

我非常喜欢Microsofts最新的语音识别(和SpeechSynthesis)产品。 http://msdn.microsoft.com/en-us/library/ms554855.aspx http://estellasays.blogspot.com/2009/04/speech-recognition-in-cnet.html 但是我觉得在使用语法时我有点受限。 不要误会我的语法,语法识别确切地指出了要注意的单词/短语,但是,如果我想要它能够识别出一些我没注意到的东西呢? 或者我想解析一个半预定命令名和半随机字的短语? 例如.. 情景A – 我说“谷歌[漏油事件]”,我希望它用括号中的搜索结果打开谷歌,这可能是任何东西。 场景B – 我说“找到[曼彻斯特]”,我想让它在Google地图或其他任何未预先确定的地方搜索曼彻斯特 我希望它知道’谷歌’和’定位’是命令,它是参数之后的东西(可能是任何东西)。 问题:有没有人知道如何混合使用预先确定的语法(语音识别应该识别的单词)和不在预定语法中的单词? 代码片段.. using System.Speech.Recognition; … … SpeechRecognizer rec = new SpeechRecognizer(); rec.SpeechRecognized += rec_SpeechRecognized; var c = new Choices(); c.Add(“search”); var gb = new GrammarBuilder(c); var g = new Grammar(gb); rec.LoadGrammar(g); rec.Enabled = true; … … void rec_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) […]

如何在ac#应用程序中打开sapi列车窗口?

我想在我的应用程序中打开Windows sapi火车窗口。 我发现这个进程的文件路径是“C:\ Windows \ System32 \ Speech \ SpeechUX \ SpeechUXWiz.exe”。但是当我尝试通过dobule点击它打开它时,它会发现。我试着通过进程在我的应用程序中打开这个文件。 start()方法也是faild。 Process.Start(@”C:\Windows\System32\Speech\SpeechUX\SpeechUXWiz.exe”); 有人知道怎么打开它吗? 在sapi中有没有这样做的界面? 谢谢! 我的系统是windows7 x64。

帮助SAPI v5.1 SpeechRecognitionEngine始终使用C#提供相同的错误结果

我正在玩这个SAPI v5.1库。 所以我正在测试我的样本WAV文件。 ( 从这里下载 )。 无论如何,该文件中的声音清晰简单。 它只包含一个三号字。 现在当我运行以下代码时,我得到数字8或“8”。 如果我删除它,我得到7.如果我尝试随机化列表我得到不同的结果,依此类推。 我真的很困惑,开始认为SAPI库中的SpeachRecognition根本不起作用…… 无论如何这里是我正在做的, private void button1_Click(object sender, EventArgs e) { //Add choices to grammar. Choices mychoices = new Choices(); mychoices.Add(“one”); mychoices.Add(“two”); mychoices.Add(“three”); mychoices.Add(“four”); mychoices.Add(“five”); mychoices.Add(“six”); mychoices.Add(“seven”); mychoices.Add(“eight”); mychoices.Add(“nine”); mychoices.Add(“zero”); mychoices.Add(“1”); mychoices.Add(“2”); mychoices.Add(“3”); mychoices.Add(“4”); mychoices.Add(“5”); mychoices.Add(“6”); mychoices.Add(“7”); mychoices.Add(“8”); mychoices.Add(“9”); mychoices.Add(“0”); Grammar myGrammar = new Grammar(new GrammarBuilder(mychoices)); //Create […]