为了方便调用暂停.继续的方法.要将speech的功能写成一个类.直接附上代码: using System; using System.Collections.Generic; using System.Linq; using System.Speech.Synthesis; using System.Text; using System.Speech; namespace WindowsFormsApplication1 { public class TextToSpeak { //想要实现暂停…
C# 使用System.Speech 进行语音播报和识别 using System.Speech.Synthesis; using System.Speech.Recognition; //语音识别 SpeechRecognitionEngine recEngine = new SpeechRecognitionEngine(); SpeechSynthesizer speech = new SpeechSynthesizer(); //**************************使用S…
本程序是口算两位数乘法,随机生成两个两位数,用语音读出来.然后开启语音识别,接受用户输入,知道答案正确关闭语音识别.用户说答案时,可以说“再说一遍”重复题目. 关键是GrammarBuilder和Choices的用法. 首先来看看如何获得已安装的语音识别引擎 void showInstalled() { Console.WriteLine("installed recognizers"); foreach (var i in SpeechRecognitionEngine.Instal…
using System; using System.Speech.Synthesis; namespace testvoice { class Program { static void Main(string[] args) { SpeechSynthesizer synth = new SpeechSynthesizer(); //获取本机上所安装的所有的Voice的名称 string voicestring = ""; foreach (InstalledVoice iv in…
使用微软语音库 使用微软语音库可以很快速的制作一个小应用,比如一个唐诗的朗诵工具.本示例也是使用微软语音库,制作了一个唐诗宋词朗诵的应用,仅供加深学习印象 首先是要引入System.Speech库 然后using System.Speech.Synthesis; 此后就可以使用SpeechSynthesizer实例对象来朗诵了 主要代码: using System; using System.Collections.Generic; using System.ComponentModel; us…
by zhangxinxu from http://www.zhangxinxu.com/wordpress/?p=5865本文可全文转载,但需得到原作者书面许可,同时保留原作者和出处,摘要引流则随意. 一.关于HTML5语音Web Speech API HTML5中和Web Speech相关的API实际上有两类,一类是“语音识别(Speech Recognition)”,另外一个就是“语音合成(Speech Synthesis)”,这两个名词听上去很高大上,实际上指的分别是“语音转文字”,和“…
前言 今天接到领导布置的一个任务,是之前同事负责的项目.离职了,现在客户有些地方需要修改,由于我之前参与过,就落在我的头上了. 然后我就把代码弄了过来,打开发现其中需要用到水晶报表.(我觉得不好用,不想占用多余的磁盘空间,就没有安装) 想想算了,大不了重新添加一下就完事了呗. 一开始都还好,没有什么问题. 等安装到"SQL Server 运行时(X64)"时,弹了一个文件查找对话框: 在安装了Visual Studio 2008 Service Pack 1之后,添加或移除功能Visu…
prismjs 是一款轻量.可扩展的代码语法高亮库,使用现代化的 Web 标准构建,使用 Prismjs 可以快速为网站添加代码高亮功能,支持超过113中编程语言,还支持多种插件,是简洁.高效的代码高亮解决方案.科技爱好者博客就是使用了Prism.js 实现漂亮的代码语法高亮功能,本文教你如何在wordpress上快速使用Prismjs实现代码高亮. 一.下载JS和CSS文件并上传到网站根目录. 在Prismjs网站下载页面下载需要的JS和CSS文件,下载页面: http://prismjs.c…
对一个文本框添加拖拽功能: private void txtFolder_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { e.Effect = DragDropEffects.Link; this.txtFolder.Cursor = System.Windows.Forms.Cursors.Arrow;//指定鼠标形状 } else { e.Effect…
这一章节我们讨论一下扩展添加检查订单功能,以便记录并检測输入的參数. 1.domain 蛋糕类: package com.raylee.my_new_spring.my_new_spring.ch03.topic_1_8; public class Cake { private String name = ""; public String getName() { return name; } public void setName(String name) { this.name =…