Esempio n. 1
0
 /// <summary>
 /// 将文字通过语音播放出来
 /// </summary>
 /// <param name="txt"></param>
 public void PlayText(string txt)
 {
     waveIn.StopRecording();
     Task.Factory.StartNew(() =>
     {
         if (!string.IsNullOrEmpty(txt))
         {
             var bytes = XFwebApi.GetInstance().XunFeiTTS(txt);
             PlayAsBytes(bytes);
             PlayEnd();
         }
     });
 }
Esempio n. 2
0
 public static XFwebApi GetInstance()
 {
     if (xfwebApi == null)
     {
         lock (lockObj)
         {
             if (xfwebApi == null)
             {
                 xfwebApi = new XFwebApi();
             }
         }
     }
     return(xfwebApi);
 }