asp.net引用System.Speech实现语音提示
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 synth.GetInstalledVoices())
{
voicestring += iv.VoiceInfo.Name + ",";
}
//voicestring的值是Microsoft Lili,Microsoft Anna
synth.Volume = ;
synth.Rate = -;
//根据Voice的name属性确定要使用的Voice
//synth.SelectVoice("Microsoft Anna");//美式发音,但只能读英文
synth.SelectVoice("Microsoft Lili");//能读中英文
//根据文字内容合成语音
synth.Speak("你好");
Console.Read();
}
}
}
asp.net引用System.Speech实现语音提示的更多相关文章
- C# 使用System.Speech 进行语音播报和识别
C# 使用System.Speech 进行语音播报和识别 using System.Speech.Synthesis; using System.Speech.Recognition; //语音识别 ...
- System.Speech.Synthesis 添加暂停、继续功能
为了方便调用暂停.继续的方法.要将speech的功能写成一个类.直接附上代码: using System; using System.Collections.Generic; using System ...
- 【C#】语音识别 - System.Speech
一个有趣的东西,今后可能用得上. C#语音识别:在命名空间 System.Speech下SpeechSynthesizer可以将文字转换成语音 贴出代码: public partial class F ...
- asp.net使用SpeechSynthesizer类生成语音文件部署到iis遇到的几个坑
首先需要引入命名空间System.Speech.Synthesis,代码如下: using (var speechSyn = new SpeechSynthesizer()) { speechSyn. ...
- C# 使用微软自带的Speech进行语音输出
1.在VS中使用微软自带的Speech进行语音播报,首先需要添加引用: 2.具体实现逻辑代码如下:
- System.Speech使用
使用微软语音库 使用微软语音库可以很快速的制作一个小应用,比如一个唐诗的朗诵工具.本示例也是使用微软语音库,制作了一个唐诗宋词朗诵的应用,仅供加深学习印象 首先是要引入System.Speech库 然 ...
- .net引用System.Data.SQLite操作SQLite
之所以要做这个笔记,是因为在.NET中使用System.Data.SQLite的时候,遇到了些问题,这些问题是相对于引用其他dll没有遇到过的,所以作个笔记,记录一下. 简单起见,首先建立一个控制台项 ...
- C# winform语音提示
1.SpeechSynthesizer文字转音频 项目添加引用:System.Speech using(SpeechSynthesizer speech = new SpeechSynthesizer ...
- 转 mvc项目中,解决引用jquery文件后智能提示失效的办法
mvc项目中,解决用Url.Content方法引用jquery文件后智能提示失效的办法 这个标题不知道要怎么写才好, 但是希望文章的内容对大家有帮助. 场景如下: 我们在用开发开发程序的时候,经常 ...
随机推荐
- oracle启动服务和监听
1.故障问题:tomcat显示启动oracle数据库失败,数据库服务启动正常 操作1:重启tomcat查看错误信息 2:重启数据库服务 命令: (1) 启动Oracle服务 C:\Users\Admi ...
- python语法_模块
方便调用的分组函数文件,一个py模块就是一个模块,模块分三类 python标准库 第三方模块 应程序自定义模块 模块的掉用: 可以把多个功能(函数)包含在一个模块文件里,调用时直接使用import 就 ...
- Trie树(字典树)的介绍及Java实现
简介 Trie树,又称为前缀树或字典树,是一种有序树,用于保存关联数组,其中的键通常是字符串.与二叉查找树不同,键不是直接保存在节点中,而是由节点在树中的位置决定.一个节点的所有子孙都有相同的前缀,也 ...
- [Swift]LeetCode889. 根据前序和后序遍历构造二叉树 | Construct Binary Tree from Preorder and Postorder Traversal
Return any binary tree that matches the given preorder and postorder traversals. Values in the trave ...
- [Swift]LeetCode909. 蛇梯棋 | Snakes and Ladders
On an N x N board, the numbers from 1 to N*N are written boustrophedonically starting from the botto ...
- ubuntu 16.04 更改默认Python版本
一般Ubuntu默认的Python版本都为2.x, 如何改变Python的默认版本呢?假设我们需要把Python3.5设置为默认版本: 首先查看Python默认版本: ubuntu@user~$:py ...
- Volatile的那些事
上一篇中,我们了解了Synchronized关键字,知道了它的基本使用方法,它的同步特性,知道了它与Java内存模型的关系,也明白了Synchronized可以保证"原子性",&q ...
- Xamarin.Android多窗口传值【1】
这种非常常见的场景我觉得大家都遇到过,那么我么可以通过Activity进行编码传值. using System.Text; using System; using Android.App; using ...
- Python爬虫入门教程 21-100 网易云课堂课程数据抓取
写在前面 今天咱们抓取一下网易云课堂的课程数据,这个网站的数据量并不是很大,我们只需要使用requests就可以快速的抓取到这部分数据了. 你第一步要做的是打开全部课程的地址,找出爬虫规律, 地址如下 ...
- 用Maxima画出一些有趣的图
Maxima可以画出Chaos.Duffing .Fern.Lorenz.Rossler .Portraits .Mandelbrot.Staircase.Triangles等有趣的图... Chao ...