Appearance
获取音频时长
方法名
getDuration
用法
- 用法如下:js
module.getDuration({ path: "/storage/emulated/0/Download/WeiXin/赵雷-成都.mp3" }, res => { console.log(res) }); - 参数说明
参数名 参数类型 是否必填 默认值 参数描述 path String 是 无 本地绝对路径或网络地址
回调
- 示例json
{ "data": { "duration": 445518 }, "message": "", "code": 0 } - 回调说明:
参数名 参数类型 参数描述 message String 消息提示 data Object 数据对象 data.duration Integer 音频总时长,单位:毫秒 code Integer 返回类型,0.成功,其他:失败