语音播报

Posted 6b23

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了语音播报相关的知识,希望对你有一定的参考价值。

     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;
            }
        }

以上是关于语音播报的主要内容,如果未能解决你的问题,请参考以下文章