中文文本到语音朗读.NET3.5 For Windows 和Windows Mobile

来源:互联网 发布:古墓丽影10 for mac 编辑:程序博客网 时间:2024/05/22 07:39

非凡科技简单语音朗读二次开发包

应用说明

非凡科技简单语音朗读二次开发包是一种最为简单的语音朗读解决方案,不需要任何的第三方TTS引擎支持(如微软)而可以独立发布的语音朗读开发程序。

非凡科技简单语音朗读二次开发包仅适用于比较小型且简单的应用场合,并不适合复杂场合,对于要求朗读连贯的应用不建议使用。

非凡科技简单语音朗读二次开发包占据存储空间为26MB,朗读语音为女声中文。

朗读语音:女声中文(汉字、基本标点符号、数字)

容错方式:未识别语音将被忽略

适用开发语言:.NET3.5版本及以上

For Windows 平台

命名空间:SantookTTSLibForNET35

工作类名:ClassSpeech

方法

方法名

参数

描述

New()

LibPath As String

初始化语音朗读字典,如果Lib文件夹放置于当前应用程序执行根目录下,则LibPath为当前程序的启动文件夹路径

ReadTextToSpeech

Text As String

朗读参数Text所指定的内容(包括识别中文汉字、阿拉伯数字、基本标点符号),该方法使用当前UI线程进行朗读,要进行较长的朗读,请使用多线程。

属性

属性名

类型

描述

LibDectory

Readonly String

当前字典工作目录,只读

VB.NET示例代码:

Public Class Form1

    Private tts As SantookTTSLibForNET35.ClassSpeech

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        tts.ReadTextToSpeech(Me.RichTextBox1.Text)

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        tts = New SantookTTSLibForNET35.ClassSpeech(New IO.FileInfo(Application.ExecutablePath).DirectoryName)

    End Sub

End Class

C#示例代码:

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;

namespace 非凡科技SampleTTS二次开发包演示代码CSharp

{

    public partial class Form1 : Form

    {

        private SantookTTSLibForNET35.ClassSpeech TTS;

        public Form1()

        {

            InitializeComponent();

        }

        private void button1_Click(object sender, EventArgs e)

        {

            TTS.ReadTextToSpeech(this.richTextBox1.Text);

        }

        private void Form1_Load(object sender, EventArgs e)

        {

            TTS = new SantookTTSLibForNET35.ClassSpeech(new System.IO.FileInfo(Application.ExecutablePath).DirectoryName);

        }

    }

}

For Windows Mobile 平台

命名空间:SantookTTSLibraryForWM

工作类名:SpeechTextForWM

方法

方法名

参数

描述

New()

LibPath As String

初始化语音朗读字典,如果Lib文件夹放置于当前应用程序执行根目录下,则LibPath为当前程序的启动文件夹路径

ReadTextToSpeech

Text As String

朗读参数Text所指定的内容(包括识别中文汉字、阿拉伯数字、基本标点符号),该方法使用当前UI线程进行朗读,要进行较长的朗读,请使用多线程。

属性

属性名

类型

描述

LibDectory

Readonly String

当前字典工作目录,只读

VB.NET For Windows Mobile示例代码 :

Public Class Form1

    Private TTS As SantookTTSLibraryForWM.SpeechTextForWM

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        TTS.ReadTextToSpeech(Me.TextBox1.Text)

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        TTS = New SantookTTSLibraryForWM.SpeechTextForWM(IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase))

    End Sub

End Class

C# For Windows Mobile 示例代码:

using System;

using System.Linq;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

namespace 非凡TTS开发包CSharpForWM

{

    public partial class Form1 : Form

    {

        private SantookTTSLibraryForWM.SpeechTextForWM TTS;

        public Form1()

        {

            InitializeComponent();

        }

        private void Form1_Load(object sender, EventArgs e)

        {

            TTS = new SantookTTSLibraryForWM.SpeechTextForWM(IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase));

        }

        private void button1_Click(object sender, EventArgs e)

        {

            TTS.ReadTextToSpeech(this.textBox1.Text);

        }

    }

}

软件开发:宋晓。

邮箱:santook@vip.qq.com

                                                                                                                             开发包请到我的下载中下载

原创粉丝点击