Constructor
new Audio(path, duration)
构造一个路径为 path,显示时长为 duration 的语音消息元素。
若不传入 duration,则 toElement 函数会尝试自动计算语音时长(可能完全不准确)。
Parameters:
Properties| Name | Type | Description |
|---|---|---|
path | String | 音频路径。 |
duration | Number | 语音显示时长。单位为秒。 |
| Name | Type | Description |
|---|---|---|
#path | String | 音频路径。 |
#duration | Number | 语音显示时长(单位:秒)。 |
- Source
Methods
getDuration() → {Number}
返回该消息元素的 #duration 属性。
- Source
Returns:
该消息元素的 #duration 属性。
- Type:
- Number
getPath() → {String}
返回该消息元素的 #path 属性。
- Source
Returns:
该消息元素的 #path 属性。
- Type:
- String
(async) toElement() → {Native}
构造并返回该消息元素所对应的 element 对象。
- Source
Returns:
该消息元素所对应的 element 对象。
- Type:
- Native
(static) getElementType() → {Number}
返回该消息元素所对应的 elementType,值为 4。
- Source
Returns:
该消息元素所对应的 elementType,值为 4。
- Type:
- Number