new EMVoiceMessageBody(localPath, duration)
- Source:
Voice message body constructor.
Parameters:
Name | Type | Description |
---|---|---|
localPath |
String | 语音文件本地路径 |
duration |
Number | 语音文件时间 |
Methods
displayName() → {String}
- Source:
Get display name of the attachment.
Returns:
返回消息展示名
- Type
- String
downloadStatus() → {Number}
- Source:
Get file downloading status
Returns:
返回消息下载状态
- Type
- Number
duration() → {Number}
- Source:
Get voice playing duration in seconds.
Returns:
返回语音持续时间
- Type
- Number
fileLength() → {Number}
- Source:
Get file length of the attachment.
Returns:
返回消息长度
- Type
- Number
localPath() → {String}
- Source:
Get local path of the attachment.
Returns:
返回消息本地存储路径
- Type
- String
remotePath() → {String}
- Source:
Get remote path of the attachment.
Returns:
返回消息在服务器的存储路径
- Type
- String
secretKey() → {String}
- Source:
Get secret key of the attachment, it's used to download attachment from server.
Returns:
返回消息加密密钥
- Type
- String
setDisplayName(displayName) → {void}
- Source:
Set display name of the attachment.
Parameters:
Name | Type | Description |
---|---|---|
displayName |
String | 消息展示名 |
Returns:
- Type
- void
setDownloadStatus(downloadStatus) → {void}
- Source:
Set file downloading status.
Note: Usually, user should NOT call this method directly.
Parameters:
Name | Type | Description |
---|---|---|
downloadStatus |
Number | 消息下载状态 |
Returns:
- Type
- void
setDuration(duration) → {void}
- Source:
Set voice playing duration in seconds.
Parameters:
Name | Type | Description |
---|---|---|
duration |
Number | 语音持续时间 |
Returns:
- Type
- void
setFileLength(fileLength) → {void}
- Source:
Set file length of the attachment.
Note: It's usually not necessary to call this method, will calculate file length automatically when setting local path.
Parameters:
Name | Type | Description |
---|---|---|
fileLength |
Number | 消息长度 |
Returns:
- Type
- void
setLocalPath(localPath) → {void}
- Source:
Set local path of the attachment.
Note: should NOT change the local path of the Received message.
Parameters:
Name | Type | Description |
---|---|---|
localPath |
String | 消息本地存储路径 |
Returns:
- Type
- void
setRemotePath(remotePath) → {void}
- Source:
Set remote path of the attachment.
Note: It's internal used, user should never need to call this method.
Parameters:
Name | Type | Description |
---|---|---|
remotePath |
String | 消息在服务器的存储路径 |
Returns:
- Type
- void
setSecretKey(secretKey) → {void}
- Source:
Set secret key of the attachment.
Note: It's internal used, user should never need to call this method.
Parameters:
Name | Type | Description |
---|---|---|
secretKey |
String | 消息加密密钥 |
Returns:
- Type
- void
type() → {Number}
- Source:
Get message body type.
Returns:
消息类型
- Type
- Number