Chat SDK for Android v1.1.0
agora java chat SDK
Public Member Functions | Static Public Attributes | 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)
 
 VoiceMessageBody (EMAVoiceMessageBody body)
 
int getLength ()
 
long getFileSize ()
 
String toString ()
 
int describeContents ()
 
void writeToParcel (Parcel dest, int flags)
 
- Public Member Functions inherited from io.agora.chat.FileMessageBody
 FileMessageBody (String localPath)
 
 FileMessageBody (Uri localPath)
 
 FileMessageBody (EMAFileMessageBody body)
 
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)
 

Static Public Attributes

static final Parcelable.Creator< VoiceMessageBodyCREATOR
 

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.

Member Data Documentation

◆ CREATOR

final Parcelable.Creator<VoiceMessageBody> io.agora.chat.VoiceMessageBody.CREATOR
static
Initial value:
= new Parcelable.Creator<VoiceMessageBody>() {
public VoiceMessageBody createFromParcel(Parcel in) {
return new VoiceMessageBody(in);
}
public VoiceMessageBody[] newArray(int size) {
return new VoiceMessageBody[size];
}
}

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