资源简介
研究了一下C#的文本语音朗读,写了一个小demo,在32位win7下可以运行朗读,还可以将朗读保存WAV,,,大家可以参考参考

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DotNetSpeech;
namespace SpeechApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
///
/// 朗读
///
///
///
private void ButtonSynthesis_Click(object sender EventArgs e)
{
try
{
DotNetSpeech.SpeechVoiceSpeakFlags SSF = DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync;
DotNetSpeech.SpVoice vo = new SpVoiceClass();
vo.Speak(this.textBox1.Text SSF);
}
catch (System.Exception ec)
{
MessageBox.Show(ec.ToString() “SpeechApp“ MessageBoxButtons.OK System.Windows.Forms.MessageBoxIcon.Error);
}
}
///
/// 生成声音文件
///
///
///
private void ButtonTTStoWave_Click(object sender EventArgs e)
{
try
{
DotNetSpeech.SpeechVoiceSpeakFlags SSF = DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync;
DotNetSpeech.SpVoice vo = new SpVoiceClass();
System.Windows.Forms.SaveFileDialog SFD = new System.Windows.Forms.SaveFileDialog();
SFD.Filter = “All files (*.*)|*.*|wav files (*.wav)|*.wav“;
SFD.title = “Save to a wav file“;
SFD.FilterIndex = 2;
SFD.RestoreDirectory = true;
if (SFD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
DotNetSpeech.SpeechStreamFileMode SSFM = DotNetSpeech.SpeechStreamFileMode.SSFMCreateForWrite;
DotNetSpeech.SpFileStream SFS = new DotNetSpeech.SpFileStreamClass();
SFS.Open(SFD.FileName SSFM false);
vo.AudioOutputStream = SFS;
vo.Speak(this.textBox1.Text SSF);
vo.WaitUntilDone(System.Threading.Timeout.Infinite);
SFS.Close();
}
}
catch (System.Exception ec)
{
MessageBox.Show(ec.ToString() “SpeechApp“ MessageBoxButtons.OK System.Windows.Forms.MessageBoxIcon.Error);
}
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 163840 2017-02-22 14:32 SpeechApp\SpeechApp\bin\Debug\DotNetSpeech.dll
文件 9728 2017-02-22 16:05 SpeechApp\SpeechApp\bin\Debug\SpeechApp.exe
文件 26112 2017-02-22 16:05 SpeechApp\SpeechApp\bin\Debug\SpeechApp.pdb
文件 11608 2017-02-22 16:08 SpeechApp\SpeechApp\bin\Debug\SpeechApp.vshost.exe
文件 490 2010-03-17 22:39 SpeechApp\SpeechApp\bin\Debug\SpeechApp.vshost.exe.manifest
文件 2701 2017-02-22 16:05 SpeechApp\SpeechApp\Form1.cs
文件 3463 2017-02-22 16:05 SpeechApp\SpeechApp\Form1.Designer.cs
文件 5817 2017-02-22 16:05 SpeechApp\SpeechApp\Form1.resx
文件 6278 2017-02-22 16:05 SpeechApp\SpeechApp\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 566 2017-02-22 16:05 SpeechApp\SpeechApp\obj\x86\Debug\GenerateResource-ResGen.read.1.tlog
文件 922 2017-02-22 16:05 SpeechApp\SpeechApp\obj\x86\Debug\GenerateResource-ResGen.write.1.tlog
文件 2714 2017-02-22 16:01 SpeechApp\SpeechApp\obj\x86\Debug\ResolveAssemblyReference.cache
文件 1083 2017-02-22 16:08 SpeechApp\SpeechApp\obj\x86\Debug\SpeechApp.csproj.FileListAbsolute.txt
文件 9728 2017-02-22 16:05 SpeechApp\SpeechApp\obj\x86\Debug\SpeechApp.exe
文件 180 2017-02-22 16:05 SpeechApp\SpeechApp\obj\x86\Debug\SpeechApp.Form1.resources
文件 26112 2017-02-22 16:05 SpeechApp\SpeechApp\obj\x86\Debug\SpeechApp.pdb
文件 180 2017-02-22 16:01 SpeechApp\SpeechApp\obj\x86\Debug\SpeechApp.Properties.Resources.resources
文件 490 2017-02-22 15:56 SpeechApp\SpeechApp\Program.cs
文件 1370 2017-02-22 15:56 SpeechApp\SpeechApp\Properties\AssemblyInfo.cs
文件 2869 2017-02-22 15:56 SpeechApp\SpeechApp\Properties\Resources.Designer.cs
文件 5612 2017-02-22 15:56 SpeechApp\SpeechApp\Properties\Resources.resx
文件 1095 2017-02-22 15:56 SpeechApp\SpeechApp\Properties\Settings.Designer.cs
文件 249 2017-02-22 15:56 SpeechApp\SpeechApp\Properties\Settings.settings
文件 3816 2017-02-22 16:01 SpeechApp\SpeechApp\SpeechApp.csproj
文件 869 2017-02-22 15:56 SpeechApp\SpeechApp.sln
..A..H. 19456 2017-02-22 16:09 SpeechApp\SpeechApp.suo
目录 0 2017-02-22 15:56 SpeechApp\SpeechApp\obj\x86\Debug\TempPE
目录 0 2017-02-22 16:05 SpeechApp\SpeechApp\obj\x86\Debug
目录 0 2017-02-22 16:01 SpeechApp\SpeechApp\bin\Debug
目录 0 2017-02-22 15:56 SpeechApp\SpeechApp\obj\x86
............此处省略8个文件信息
相关资源
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
- C#指纹识别系统程序 报告
- c# 高校档案信息管理系统
评论
共有 条评论