基本信息
源码名称:TTS语音播报实例源码(可朗读中文、英文)
源码大小:2.49M
文件格式:.zip
开发语言:C#
更新时间:2017-05-23
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 2 元 
   源码介绍

支持不同人种的发音(老年人、男生、女生等) 

 



 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;


namespace TTS_Test
{
    public partial class Form1 : Form
    {
        private System.Media.SoundPlayer player;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            button1.Enabled = false;
            string c1 = "appid=4e9d1fa5";
            TTS tts = new TTS(c1);
            tts.Finished  = tts_Finished;
            tts.vol = enuVol.x_loud;
            tts.speed = enuSpeed.medium;
            tts.speeker = (enuSpeeker)comboBox1.SelectedIndex;
            tts.MultiSpeek(textBox1.Text, "audio.wav");
            button1.Enabled = true;
            //player = new System.Media.SoundPlayer("audio.wav");
            //player.Play();
        }
        void tts_Finished(object sender, TTS.JinDuEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine(e.AllP.ToString());
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            foreach (string s in Enum.GetNames(typeof(enuSpeeker)))
                comboBox1.Items.Add(s);
            comboBox1.SelectedIndex = 0;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Random rd = new Random();
            int num = rd.Next(0, 4);
            label1.Text = num.ToString();
        }
    }
}