Chat SDK for Android v1.2.1
agora java chat SDK
Public Member Functions | List of all members
io.agora.chat.VoiceMessageBody Class Reference
Inheritance diagram for io.agora.chat.VoiceMessageBody:
io.agora.chat.FileMessageBody io.agora.chat.MessageBody

Public Member Functions

 VoiceMessageBody (File voiceFile, int duration)
 
 VoiceMessageBody (Uri voiceFile, int duration)
 
int getLength ()
 
long getFileSize ()
 
- Public Member Functions inherited from 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 Member Functions inherited from io.agora.chat.MessageBody
long operationTime ()
 
String operatorId ()
 
int operationCount ()
 

Detailed Description

The voice message body.

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

Constructor & Destructor Documentation

◆ VoiceMessageBody() [1/2]

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

Creates a voice message body.

Parameters
voiceFileThe path of the voice file.
durationThe voice duration in seconds.

◆ VoiceMessageBody() [2/2]

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

Creates a voice message body.

Parameters
voiceFileThe URI of the voice file.
durationThe voice duration in seconds.

Member Function Documentation

◆ getFileSize()

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

Gets the size of the voice file.

Returns
The size of the voice file in bytes.

◆ getLength()

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

Gets the voice duration.

Returns
The voice duration in seconds.

The documentation for this class was generated from the following file: