/// <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(); } }); }
public static XFwebApi GetInstance() { if (xfwebApi == null) { lock (lockObj) { if (xfwebApi == null) { xfwebApi = new XFwebApi(); } } } return(xfwebApi); }