Using the Code

  1. Add a textbox named 'txtWords' to a form.
  2. Add a button named 'btnSpeak' to a form.
  3. Add a reference to System.Speech.
  4. In the form's code-behind, add:
    Collapse | Copy Code
    using System.Windows.Forms;
    using System.Speech.Synthesis; namespace Sample
    {
    public partial Class Form1: Form
    {
    public SpeechSynthesizer _synthesizer;
    private void btnSpeak_Click(object sender, EventArgs e)
    {
    _synthesizer = new SpeechSynthesizer();
    var words = txtWords.Text;
    _synthesizer.Speak(Words);
    }
    public Form1()
    {
    InitializeComponent();
    }
    }
    }
  5. Run. Text entered into the textbox will be spoken by the computer.

Computer Talker with C# z的更多相关文章

  1. Windows2008当桌面使用

    因为需要32位系统,又想用8G内存. 一.提高开机速度   0 |" t7 A- d! `- A- R5 | 1.免除登录时按Ctrl+Alt+Del的限制 打开<开始> - & ...

  2. 20175226 2018-2019-2 《Java程序设计》第四周学习总结

    20175226 2018-2019-2 <Java程序设计>第四周学习总结 教材学习内容总结 子类与父类 格式class 子类名 extends 父类名 Object类是所有类的祖先类 ...

  3. 【Python】使用torrentParser1.03对多文件torrent的分析结果

    Your environment has been set up for using Node.js 8.5.0 (x64) and npm. C:\Users\horn1>cd C:\User ...

  4. hdu 3695:Computer Virus on Planet Pandora(AC自动机,入门题)

    Computer Virus on Planet Pandora Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 256000/1280 ...

  5. Computer Graphics Research Software

    Computer Graphics Research Software Helping you avoid re-inventing the wheel since 2009! Last update ...

  6. ACM: Gym 100935F A Poet Computer - 字典树

    Gym 100935F A Poet Computer Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d &am ...

  7. HDU 3695 Computer Virus on Planet Pandora(AC自动机模版题)

    Computer Virus on Planet Pandora Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 256000/1280 ...

  8. hdu ----3695 Computer Virus on Planet Pandora (ac自动机)

    Computer Virus on Planet Pandora Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 256000/1280 ...

  9. 【转载】shell编程——if语句 if -z -n -f -eq -ne -lt

    shell编程中条件表达式的使用 if  条件then Commandelse Commandfi                              别忘了这个结尾 If语句忘了结尾fites ...

随机推荐

  1. 多平台响应键盘事件!(适用于Cocos2dx 3.0 alpha以上版本号)

    Hello everyone! For a week I've been looking on how to make a keyboard work! I managed to figure it ...

  2. [Javascript] Get Started with LeafletJS Mapping

    Leaflet makes creating maps in the browser dead simple. With some HTML and 3 lines of JavaScript, we ...

  3. mybatis完美的实战教程

    文件夹(? )[-] (读者注:事实上这个应该叫做非常基础的入门一下下,假设你看过Hibernate了那这个就非常的简单) 文章来源:http://blog.csdn.net/techbirds_ba ...

  4. NSUInteger和NSInteger和int

    int和NSInteger其实是差不多的,但更推荐使用NSInteger,因为使用NSInteger,这样就不用考虑设备是32位还是64位了. NSUInteger是无符号的,即没有负数,NSInte ...

  5. HBase中的备份和故障恢复方法

    本文将对Apache HBase可用的数据备份机制和大量数据的故障恢复/容灾机制做简要介绍. 随着HBase在重要的商业系统中应用的大量添加,很多企业须要通过对它们的HBase集群建立健壮的备份和故障 ...

  6. Centos下的IO监控与分析

        近期要在公司内部做个Linux IO方面的培训, 整理下手头的资料给大家分享下 各种IO监视工具在Linux IO 体系结构中的位置 源自 Linux Performance and Tuni ...

  7. orczhou----MYSQL

    https://yq.aliyun.com/users/1597777588650149?spm=5176.blog11192.yqblogcon1.2.5mdGQb

  8. Java基础知识强化之IO流笔记51:IO流练习之 键盘录入学生信息按照总分排序写入文本文件中的案例

    1.  键盘录入学生信息(姓名,语文成绩,数学成绩,英语成绩),按照总分排序写入文本文件中 分析:   A:创建学生类   B:创建集合对象      TreeSet<Student>   ...

  9. Android(java)学习笔记151: SurfaceView使用

    1.SurfaceView简介       在一般的情况下,应用程序的View都是在相同的GUI线程(UI主线程)中绘制的.这个主应用程序线程同时也用来处理所有的用户交互(例如,按钮单击或者文本输入) ...

  10. oralce表空间自增长占满磁盘

    取消表空间自动增长 SELECT FILE_NAME,TABLESPACE_NAME,AUTOEXTENSIBLE,bytes/1024/1024/1024 FROM dba_data_files; ...