流式消息 Elem
Public 成员函数 | |
| String | getMarkdown () |
| byte [] | getData () |
| boolean | isStreamEnded () |
| void | startTTS (V2TIMTTSVoiceFormat voiceFormat, V2TIMCallback callback) |
| void | stopTTS (V2TIMCallback callback) |
| String | toString () |
| V2TIMElem | getNextElem () |
| void | appendElem (V2TIMElem v2TIMElem) |
|
inline |
获取流式消息 markdown 内容
|
inline |
获取流式消息二进制数据
|
inline |
获取流式消息是否结束
|
inline |
对当前流式消息开始实时 TTS 语音合成
| voiceFormat | 声音格式,选填;可设置音色 ID 和语速。 |
|
inline |
停止当前流式消息的 TTS 语音合成
|
inline |
|
inlineinherited |
|
inlineinherited |
添加下一个 elem 元素
如果您的消息需要多个 elem,可以在创建 Message 对象后,通过 Message 的 elem 对象设置下一个 elem 对象。
以 V2TIMTextElem 和 V2TIMCustomElem 多 elem 为例,示例代码如下:
V2TIMMessage message = V2TIMManager.getMessageManager().createTextMessage("test");
V2TIMCustomElem customElem = new V2TIMCustomElem();
customElem.setData("自定义消息".getBytes());
message.getTextElem().appendElem(customElem);