c#之语音功能的实现


 
  

代码示例:

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;
using SpeechLib; 
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        /// 
        /// 按下发音按钮之后,对文本中的内容执行语音功能
        /// 
        /// 
        /// 
        private void button1_Click(object sender, EventArgs e)
        {
            SpeechVoiceSpeakFlags SpFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;
            SpVoice Voice = new SpVoice();
            Voice.Speak(textBox1.Text, SpFlags);

你可能感兴趣的:(c#,c#,语音)