hyphenate_SDK4.0 4.6.0
hyphenate java IM SDK
Public 成员函数 | 所有成员列表
com.hyphenate.chat.EMVoiceMessageBody类 参考
类 com.hyphenate.chat.EMVoiceMessageBody 继承关系图:
com.hyphenate.chat.EMFileMessageBody com.hyphenate.chat.EMMessageBody

Public 成员函数

 EMVoiceMessageBody (File voiceFile, int duration)
 
 EMVoiceMessageBody (Uri voiceFile, int duration)
 
int getLength ()
 
long getFileSize ()
 
- Public 成员函数 继承自 com.hyphenate.chat.EMFileMessageBody
 EMFileMessageBody (String localPath)
 
 EMFileMessageBody (Uri localPath)
 
String getFileName ()
 
void setFileName (String fileName)
 
String getLocalUrl ()
 
void setLocalUrl (String localUrl)
 
Uri getLocalUri ()
 
void setLocalUrl (Uri localUrl)
 
String getRemoteUrl ()
 
void setRemoteUrl (String remoteUrl)
 
void setSecret (String secret)
 
String getSecret ()
 
String displayName ()
 
void setFileLength (long length)
 
EMDownloadStatus downloadStatus ()
 
void setDownloadStatus (EMDownloadStatus status)
 
- Public 成员函数 继承自 com.hyphenate.chat.EMMessageBody
long operationTime ()
 
String operatorId ()
 
int operationCount ()
 

详细描述

语音消息体。

EMVoiceMessageBody body = new EMVoiceMessageBody(voiceFile, length);
EMVoiceMessageBody(File voiceFile, int duration)
Definition: EMVoiceMessageBody.java:55

构造及析构函数说明

◆ EMVoiceMessageBody() [1/2]

com.hyphenate.chat.EMVoiceMessageBody.EMVoiceMessageBody ( File  voiceFile,
int  duration 
)

创建语音消息体。

参数
voiceFile语音文件路径。
duration语音时长,单位为秒。

◆ EMVoiceMessageBody() [2/2]

com.hyphenate.chat.EMVoiceMessageBody.EMVoiceMessageBody ( Uri  voiceFile,
int  duration 
)

创建语音消息体。

参数
voiceFile语音文件的资源标识符。
duration语音时长,单位为秒。

成员函数说明

◆ getFileSize()

long com.hyphenate.chat.EMVoiceMessageBody.getFileSize ( )

获取语音文件的大小。

返回
语音文件的大小,单位为字节。

◆ getLength()

int com.hyphenate.chat.EMVoiceMessageBody.getLength ( )

获得语音时长。

返回
语音时长,单位为秒。

该类的文档由以下文件生成: