示例#1
0
        public DiotekSpeech(string lang)
        {
            try
            {
                SetLanguage(lang);

                PTTS_U_Initialize();

                rtn0 = PTTS_U_LoadEngine(language, encoding.GetString(encoding.GetBytes(@"C:\Furo_TTS\PowerTTS-PC\PowerTTS_M_DB\" + lang.ToUpper())), 0);

                //PTTS_U_SetCharSet(IntPtr.Zero, 1); // 0 : ANSI, 1: UTF8 // unicode를 사용할땐 불필요

                if (rtn0 == 0)
                {
                    callback = new PTTSCallBack(this.PCMCallBack);
                    Trace.WriteLine("Diotek TTS engine (" + lang + ") load complete.");
                }
                else
                {
                    Trace.WriteLine("Diotek TTS engine (" + lang + ") load error!! ERR[" + rtn0.ToString() + "] = " + GetErrorString(rtn0));
                }
            }
            catch (Exception ex)
            {
                Trace.Write(ex.ToString());
            }
        }
示例#2
0
 private static extern IntPtr PTTS_U_CreateThread(IntPtr pInParam, PTTSCallBack CallBack, int Language, int SpeakerID);