示例#1
0
        public string GetVoiceURL(string queid, string departcode, string serverpath)
        {
            View_Screen data = screendao.GetView_BigScreemDisplayById(queid, departcode);
            //将眼科一诊室的语言改成眼科衣诊室{解决眼科一(yi 四声)诊室}的问题

            //文字部分模板替换
            string text = "";

            text = "请[num]号,[name]到[pos], [dep]";
            text = text.Replace(Constant.SPEECH_PATIENTNUM, data.PATIENT_ID);
            text = text.Replace(Constant.SPEECH_PATIENTNAME, data.NAME);
            text = text.Replace(Constant.SPEECH_ROOMPOSITION, Convert.ToString(roomDao.GetRoomByKey(Convert.ToString(data.DEPT_CODE)).FLOOR));
            text = text.Replace(Constant.SPEECH_ROOM, data.CLINIC_NAME);
            text = text.Replace("_", "");

            string[] args = new string[] { text, serverpath, "" };  //文本 服务器路径 返回值

            //开启线程执行语音合成
            Thread t = new Thread(GenerateVoice);

            t.Start(args);
            t.Join();

            return(args[2]);
        }
示例#2
0
        /// <summary>
        /// 合成语音信息
        /// </summary>
        /// <param name="patientid">检查人的id</param>
        /// <param name="departcode">检查科室</param>
        /// <param name="clincid"> 检查诊室</param>
        public static void  GetVoiceURL(string patientid, string departcode, decimal clincid)
        {
            View_Screen data = screendao.GetView_BigScreemDisplayById(patientid, departcode);
            //将眼科一诊室的语言改成眼科衣诊室{解决眼科一(yi 四声)诊室}的问题

            //文字部分模板替换
            string text = "";

            text = "请[num]号,[name]到[pos], [dep]";
            text = text.Replace(Constant.SPEECH_PATIENTNUM, data.PATIENT_ID);
            text = text.Replace(Constant.SPEECH_PATIENTNAME, data.NAME);
            text = text.Replace(Constant.SPEECH_ROOMPOSITION, Convert.ToString(roomDao.GetRoomByKey(Convert.ToString(data.DEPT_CODE)).FLOOR));
            text = text.Replace(Constant.SPEECH_ROOM, data.CLINIC_NAME);
            text = text.Replace("_", "");


            string[] args = new string[] { text, "" };   //文本 服务器路径 返回值



            //开启线程执行语音合成
            Thread t = new Thread(GenerateVoice);

            t.Start(args);
            t.Join();


            if (voiceDao.FindVoice(patientid, departcode, clincid) == 0)
            {
                T_VOICE voice = new T_VOICE();
                voice.DEPT_CODE  = departcode;
                voice.PATIENT_ID = patientid;
                voice.CLINIC_ID  = clincid;
                voice.VOICES     = text;
                //将这个声音实体插入数据库
                voiceDao.addVoice(voice);
            }
            else
            {
                string message = "该声音已经加入数据库";
            }
        }