我也遇到了先下载,在拿得到的地址去播放,确实走了success,但是完全没有声音啊,怎么破。有人解决了吗?
var url = 'http://ot0t7lbj0.bkt.clouddn.com/1510035399777.amr?e=1510039013&token=Qt8wTRR_kJdyK8q1z0DrYB8iufe9bgiFBeUHhMxR:IEz8cu99NiO8coS-pmv0tJW2r6E='
wx.downloadFile({
url: url,
success: function (res) {
console.log(res.tempFilePath)
wx.playVoice({
filePath: res.tempFilePath,
success:function(res) {
console.log(res)
},
complete: function (res) {
console.log('playVoice res')
console.log(res)
}
})
}
})
打印地址:
wxfile://tmp_388763900o6zAJs9YVxP64hKIK5Dc11Lwmg7sf83d83bd75ecb66dc4732dae1659b9bc.amr
index.js [sm]:108 Object {errMsg: "playVoice:ok"}
index.js [sm]:111 playVoice res
index.js [sm]:112 Object {errMsg: "playVoice:ok"}