【C#】语音识别 - System.Speech
一个有趣的东西,今后可能用得上。
C#语音识别:在命名空间 System.Speech下SpeechSynthesizer可以将文字转换成语音

贴出代码:
public partial class Form1 : Form
{
private SpeechSynthesizer ss;
public Form1()
{
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{
ss = new SpeechSynthesizer();
} private void button1_Click(object sender, EventArgs e)
{
ss.Rate = trackbarSpeed.Value;
ss.Volume = trackbarVoice.Value;
ss.SpeakAsync(txtSpeechText.Text);
} private void button2_Click(object sender, EventArgs e)
{
ss.Pause();
} private void button3_Click(object sender, EventArgs e)
{
ss.Resume();
} private void button4_Click(object sender, EventArgs e)
{
SpeechSynthesizer ss = new SpeechSynthesizer();
ss.Rate = trackbarSpeed.Value;
ss.Volume = trackbarVoice.Value;
SaveFileDialog savefd = new SaveFileDialog();
savefd.Filter = "wave Files|*.wav";
ss.SetOutputToWaveFile(savefd.FileName);
ss.Speak(txtSpeechText.Text);
ss.SetOutputToDefaultAudioDevice();
MessageBox.Show("完成录音~~~", "提示");
} private void button5_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
【C#】语音识别 - System.Speech的更多相关文章
- C#的语音识别 using System.Speech.Recognition;
using System; using System.Collections.Generic; using System.Linq; using System.Speech.Recognition; ...
- C#中的System.Speech命名空间初探
本程序是口算两位数乘法,随机生成两个两位数,用语音读出来.然后开启语音识别,接受用户输入,知道答案正确关闭语音识别.用户说答案时,可以说“再说一遍”重复题目. 关键是GrammarBuilder和Ch ...
- 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 ...
- asp.net引用System.Speech实现语音提示
using System; using System.Speech.Synthesis; namespace testvoice { class Program { static void Main( ...
- System.Speech使用
使用微软语音库 使用微软语音库可以很快速的制作一个小应用,比如一个唐诗的朗诵工具.本示例也是使用微软语音库,制作了一个唐诗宋词朗诵的应用,仅供加深学习印象 首先是要引入System.Speech库 然 ...
- python之语音识别(speech模块)
1.原理 语音操控分为 语音识别和语音朗读两部分. 这两部分本来是需要自然语言处理技能相关知识以及一系列极其复杂的算法才能搞定,可是这篇文章将会跳过此处,如果你只是对算法和自然语言学感兴趣的话,就只有 ...
- C# ms speech文字转语音例子
最近突发奇想 想玩玩 文字转语音的东东 谷歌了一下 发现微软有一个TTS 的SDK 查了查相关资料 发现 还真不错 然后就开始玩玩Microsoft Speech SDK的 DEMO了 ...
- 玩一下C#的语音识别
在.NET4.0中,我可以借助System.Speech组件让电脑来识别我们的声音. 以上,当我说"name",显示"Darren",我说"age&q ...
随机推荐
- 动态规划-----hdu 1024 (区间连续和)
给定一个长度为n的区间:求m段连续子区间的和 最大值(其中m段子区间互不相交) 思路: dp[i][j]: 前j个元素i个连续区间最大值 (重要 a[j]必须在最后一个区间内) 转移方程:dp[i][ ...
- xdoj1194----(bsgs-用数组实现链表 真的是好啊)
#include <iostream> #include <algorithm> #include <cstdio> #include <cstring> ...
- Red Hat OpenShift
Core Concepts 基本概念 Master Master监控其他Node和Pod 提供Web Console Node Node是k8s的工作机器 Node中运行Pod,pod可以在node中 ...
- ionic后台返回的数据是html模板的时候,解析html文件的方法:
1.后台返回来的数据格式是: { "state":"100", "data":[ {"Content": "\ ...
- Django之路由配置系统(urlConfig)
简而言之,django的路由系统作用就是使views里面处理数据的函数与请求的url建立映射关系.使请求到来之后,根据urls.py里的关系条目,去查找到与请求对应的处理方法,从而返回给客户端http ...
- C++中的const关键字学习笔记
一.const引用 1. 例子一 #include <iostream> using namespace std; class sp { public: sp() {cout<< ...
- Scala之偏函数Partial Function
https://blog.csdn.net/bluishglc/article/details/50995939 从使用case语句构造匿名函数谈起在Scala里,我们可以使用case语句来创建一个匿 ...
- ORM 之常用重点 ******
总体介绍orm>>点我 单表查询api汇总 如 distinc(),order_by() id__gt=1 id__inrange=[ 1,3 ] 左右都包含 设置logg ...
- MySql安装完成后,Navicat连接不上的问题
Navicat连接mysql8.0.1版本出现1251--Client does not support authentication protocol requested by server的解决 ...
- 来自工厂的 PCB 封装建议
来自工厂的 PCB 封装建议 以前一直没有注意,现在终于知道了,PCB 的封装方向角度是不可以乱摆的,要根据实际编带情况画. 以实物的编带为参考确定 PCB 封装的画法. 而且编带都有标准. 强烈建议 ...