码迷,mamicode.com
首页 > 其他好文 > 详细

语音播报

时间:2020-01-17 16:16:41      阅读:84      评论:0      收藏:0      [点我收藏+]

标签:div   catch   message   try   vat   throw   required   else   sas   

     public delegate void SpeechDelegate(string strGNo, string strNumber);
        private void SpeechNumber(string strGNo, string strNumber)
        {
            try
            {
                if (this.InvokeRequired)
                {
                    this.BeginInvoke(new SpeechDelegate(this.SpeechNumber), strGNo, strNumber);
                }
                else
                {
                    SpeechVoiceSpeakFlags SpFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;
                    SpVoice Voice = new SpVoice();
                    Voice.Voice = Voice.GetVoices().Item(0);
                    Voice.Rate = 0;
                    int i = Voice.Speak("" + strNumber + "" + strPatientName + "" + strGNo + "号窗口", SpFlags);
                }
            }
            catch (Exception ex)
            {
                LogCommon.WriteLog(ex.Source.ToString() + "-" + ex.TargetSite.Name + "-" + ex.Message);
                throw ex;
            }
        }

语音播报

标签:div   catch   message   try   vat   throw   required   else   sas   

原文地址:https://www.cnblogs.com/6B23/p/12206290.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!