public static void TextPut(string sessionID, string text, TtsSessionParameters parameters = null) { int length = Encoding.Unicode.GetByteCount(text); MspErrors result = QTTSTextPut(sessionID, text, (uint)length, (parameters == null) ? null : parameters.ToString()); if (result != MspErrors.MSP_SUCCESS) { throw new Exception("向服务器发送数据," + result); } }
public static string SessionBegin(TtsSessionParameters parameters) { MspErrors result = MspErrors.MSP_SUCCESS; string sessionId = MarshalUtils.Ptr2Str(QTTSSessionBegin(parameters.ToString(), ref result)); if (result != MspErrors.MSP_SUCCESS) { throw new Exception("初始化TTS会话时发生错误," + result); } return(sessionId); }