• 大小: 0.11M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-02-23
  • 语言: C#
  • 标签: 语音  阅读  

资源简介

     本例子主要介绍如何用C#开发一个语音阅读文本的例子。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DotNetSpeech;

namespace SpeakDemo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            txtContent.Text = “该例子由Andrew提供,博客:http://www.cnblogs.com/andrew-blog“;
        }

        //获取选择的速度
        private int GetSpeedSelected()
        {
            if (rbtnFast.Checked) { return 2; }
            if (rbtnNomal.Checked) { return 0; }
            if (rbtnSlow.Checked) { return -3; }
            return 0;
        }

        //阅读函数
        private void Read(string text)
        {
            SpVoice sp = new SpVoice();
            sp.Rate = GetSpeedSelected();
            SpeechVoiceSpeakFlags sFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;
            sp.Speak(text sFlags);
        }

        private void btnRead_

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     163840  2011-12-14 22:09  SpeakDemo\SpeakDemo\bin\Debug\DotNetSpeech.dll

     文件       9728  2011-12-14 22:26  SpeakDemo\SpeakDemo\bin\Debug\SpeakDemo.exe

     文件      24064  2011-12-14 22:26  SpeakDemo\SpeakDemo\bin\Debug\SpeakDemo.pdb

     文件      11608  2011-12-14 22:28  SpeakDemo\SpeakDemo\bin\Debug\SpeakDemo.vshost.exe

     文件        490  2010-03-17 22:39  SpeakDemo\SpeakDemo\bin\Debug\SpeakDemo.vshost.exe.manifest

     文件     163840  2011-12-14 22:09  SpeakDemo\SpeakDemo\DLL\DotNetSpeech.dll

     文件       1283  2011-12-14 22:26  SpeakDemo\SpeakDemo\Form1.cs

     文件       5250  2011-12-14 22:19  SpeakDemo\SpeakDemo\Form1.Designer.cs

     文件       5817  2011-12-14 22:19  SpeakDemo\SpeakDemo\Form1.resx

     文件       5449  2011-12-14 22:26  SpeakDemo\SpeakDemo\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       2624  2011-12-14 22:14  SpeakDemo\SpeakDemo\obj\x86\Debug\ResolveAssemblyReference.cache

     文件        615  2011-12-14 22:28  SpeakDemo\SpeakDemo\obj\x86\Debug\SpeakDemo.csproj.FileListAbsolute.txt

     文件       9728  2011-12-14 22:26  SpeakDemo\SpeakDemo\obj\x86\Debug\SpeakDemo.exe

     文件        180  2011-12-14 22:26  SpeakDemo\SpeakDemo\obj\x86\Debug\SpeakDemo.Form1.resources

     文件      24064  2011-12-14 22:26  SpeakDemo\SpeakDemo\obj\x86\Debug\SpeakDemo.pdb

     文件        180  2011-12-14 22:26  SpeakDemo\SpeakDemo\obj\x86\Debug\SpeakDemo.Properties.Resources.resources

     文件        470  2011-12-14 22:07  SpeakDemo\SpeakDemo\Program.cs

     文件       1360  2011-12-14 22:07  SpeakDemo\SpeakDemo\Properties\AssemblyInfo.cs

     文件       2868  2011-12-14 22:07  SpeakDemo\SpeakDemo\Properties\Resources.Designer.cs

     文件       5612  2011-12-14 22:07  SpeakDemo\SpeakDemo\Properties\Resources.resx

     文件       1094  2011-12-14 22:07  SpeakDemo\SpeakDemo\Properties\Settings.Designer.cs

     文件        249  2011-12-14 22:07  SpeakDemo\SpeakDemo\Properties\Settings.settings

     文件       3772  2011-12-14 22:14  SpeakDemo\SpeakDemo\SpeakDemo.csproj

     文件        869  2011-12-14 22:07  SpeakDemo\SpeakDemo.sln

    ..A..H.     16384  2011-12-14 22:28  SpeakDemo\SpeakDemo.suo

     目录          0  2011-12-14 22:07  SpeakDemo\SpeakDemo\obj\x86\Debug\TempPE

     目录          0  2011-12-14 22:26  SpeakDemo\SpeakDemo\obj\x86\Debug

     目录          0  2011-12-14 22:14  SpeakDemo\SpeakDemo\bin\Debug

     目录          0  2011-12-14 22:07  SpeakDemo\SpeakDemo\obj\x86

     目录          0  2011-12-14 22:07  SpeakDemo\SpeakDemo\bin

............此处省略8个文件信息

评论

共有 条评论