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. eclipse设置快捷键sysout+Alt+/后出System.out.println!亲測可用!

    曾经一直用myeclipse,没有这方面的顾虑,如今换到了eclipse,非常多要自己设置了,比方非常多快捷键. 最经常使用的,执行到sysout ,eclipse总是不自己主动补全,非常是恼火!!! ...

  2. direct3D directX

    direct3D只是directX其中一个增强功能 DirectX是由很多API组成的,按照性质分类,可以分为四大部分,显示部分.声音部分.输入部分和网络部分. 显示部分担任图形处理的关键,分为Dir ...

  3. qsettings 中文键值 注释 支持

    #ifndef SETTINGS_H #define SETTINGS_H #include <QString> #include <QVariant> class QSett ...

  4. Android5.0之NavigationView的使用

    导航菜单的制作方式多种多样,网上也有各种炫酷效果的具体实现方式,那么今天我主要是想来说说Google在Android5.0之后推出的NavigationView的具体使用方式. NavigationV ...

  5. 解决 kindle 书籍字体颜色偏淡问题的方法

    现象 通过Markdown转换而来的mobi格式书籍都有一个大问题:字体偏淡,放在kindle上看对比度很差. 原因分析: 导致这种问题的原因,可能是因为在制作电子书的过程中,这些内容是被标注了彩色或 ...

  6. thinkphp中关于rbac的两个session

    最近在做单点登录,需要session由sso的client生成.所以研究了下RBAC的类的代码. 有了这两个seesion就可以用rbac进行权限验证 $_SESSION[C('ADMIN_AUTH_ ...

  7. CentOs6.8安装Git并安装oh my zsh

    (一)git安装 1.下载git2.4.9或其他版本 Index of /pub/software/scm/git git各个版本下载链接: https://www.kernel.org/pub/so ...

  8. 鼠标移动到表格的TD上的时候显示成一个手型的样子怎么做?

    在除了IE6的情况下,可以通过CSS的:hover伪类来实现: 假如你想设定的固定区域为: <div id="test"></div>,那么只需要在CSS样 ...

  9. Unity3D 3D坦克大战

    视频学习来源 移动和旋转 using UnityEngine; using System.Collections; /* * Adminer:sun2955 * http:www.yinghy.com ...

  10. 20160127 linux 学习笔记

    Linux学习笔记第一天 Linux基本介绍 Linux的起源和发展: 简单说linux是一种操作系统,可以安装在包括服务器.个人电脑,乃至PDA.手机.打印机等各类设备中. 起源: Linux起源于 ...