[C#] 语音朗读代码 →→→→→进入此内容的聊天室

来自 , 2020-02-15, 写在 C#, 查看 119 次.
URL http://www.code666.cn/view/309a8e73
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using SpeechLib;
  10.  语音朗读代码 需要先附加sapi.dll
  11.  
  12. namespace DotNetSpeech
  13. {
  14.     public partial class Form1 : Form
  15.     {
  16.         public Form1()
  17.         {
  18.             InitializeComponent();
  19.         }
  20.         SpVoiceClass svc = new SpVoiceClass();
  21.         private void button1_Click(object sender, EventArgs e)
  22.         {
  23.             SpeechVoiceSpeakFlags spFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;
  24.             svc.Speak("哇哈哈", spFlags);
  25.         }
  26.     }
  27. }

回复 "语音朗读代码"

这儿你可以回复上面这条便签

captcha