即时通讯 IM API 参考 v1.3.2
Agora Java IM SDK
Public 成员函数 | 所有成员列表
io.agora.chat.VoiceMessageBody类 参考
类 io.agora.chat.VoiceMessageBody 继承关系图:
io.agora.chat.FileMessageBody io.agora.chat.MessageBody

Public 成员函数

 VoiceMessageBody (File voiceFile, int duration)
 
 VoiceMessageBody (Uri voiceFile, int duration)
 
int getLength ()
 
long getFileSize ()
 
- Public 成员函数 继承自 io.agora.chat.FileMessageBody
 FileMessageBody (String localPath)
 
 FileMessageBody (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 成员函数 继承自 io.agora.chat.MessageBody
long operationTime ()
 
String operatorId ()
 
int operationCount ()
 

详细描述

语音消息体。

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

构造及析构函数说明

◆ VoiceMessageBody() [1/2]

io.agora.chat.VoiceMessageBody.VoiceMessageBody ( File  voiceFile,
int  duration 
)

创建语音消息体。

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

◆ VoiceMessageBody() [2/2]

io.agora.chat.VoiceMessageBody.VoiceMessageBody ( Uri  voiceFile,
int  duration 
)

创建语音消息体。

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

成员函数说明

◆ getFileSize()

long io.agora.chat.VoiceMessageBody.getFileSize ( )

获取语音文件的大小。

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

◆ getLength()

int io.agora.chat.VoiceMessageBody.getLength ( )

获得语音时长。

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

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