跟着微软走妥妥的,C#文字转语音有很多参数我就不说了,毕竟我也是初学者。跟大家分享最简单的方法,要好的效果得自己琢磨喽;

先添加引用System.Speech程序集;

using System;
using System.Speech.Synthesis; namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{ SpeechSynthesizer hello = new SpeechSynthesizer();
string str = "请输入您的名字";
hello.Speak(str); //Speak(string),Speak加上字符串类型的参数
Console.ReadKey();
}

我个人觉得有些时候就是要直接讲重点,要的就是这种简单粗暴,呵呵

虽是简单的代码,多段叠加就不得了啊,个人觉得编程就是要用最少的代码干最多的事。

简单的代码加上不同的想法就有不同的效果

using System;
using System.Speech.Synthesis; namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{ /*下面这个程序不支持英文,我刚接触,英文的我还不懂,呵呵*/
SpeechSynthesizer hello = new SpeechSynthesizer();
string str = "请输入您的名字";
Console.WriteLine(str);
hello.Speak(str);
string input = Console.ReadLine();
Console.WriteLine ("你好,"+input);
hello.Speak("你好,"+input);
str = "我是您的助手,很高兴认识你";
Console.WriteLine(str);
hello.Speak(str);
Console.ReadKey();
} }
}

这是我第一次写博文,写得不好的地方请多多包涵,若有错的地方欢迎指正,谢谢!

最新文章

  1. # 2015-2016-2 《Java程序设计》课程总结
  2. IE弹出窗口显示URL地址栏
  3. opencv嫁接vlfeat densesift
  4. Android中动画
  5. Redis基础知识之—— 缓存应用场景
  6. SqlBulkCoy和普通数据库操作执行速度对比
  7. insert时出现主键冲突的处理方法【转载】
  8. android _scrollview嵌套listview出现高度显示不全解决方案
  9. Matlab工程
  10. poj3176--Cow Bowling(dp:数塔问题)
  11. c#FTP操作类,包含上传,下载,删除,获取FTP文件列表文件夹等Hhelp类
  12. ADOConnection断线重连
  13. Judy Beta 阶段整体计划
  14. 把纯C的动态库代码改造成C++版的
  15. 离线安装Python包hickle,easydict
  16. 2018-2019-1 20189203《linux内核原理与分析》第六周作业
  17. RxSwift学习笔记8:filter/distinctUntilChanged/single/elementAt/ignoreElements/take/takeLast/skip/sample/debounce
  18. 学习Django,http协议,
  19. oracle 基本操作--事务
  20. nginx常用配置说明

热门文章

  1. Unity3D 物体移动到点击位置
  2. 关于我们-成功人士西装定制服务第一品牌派斯特PAISTETAILOR绅士礼服
  3. Java String.replace()方法
  4. rem布局
  5. wx
  6. [转]Visual Studio 2008中如何比较二个数据库的架构【Schema】和数据【Data】并同步
  7. MySQL常用指令
  8. C++_关键字
  9. Programming C#.Interfaces
  10. OpenCV学习(1)OpenCV简介