wx.playVoice({
filePath: that.data.http + FilePath,
success: function () {
console.log( ‘播放录音’ )
},
fail: function () {
console.log( ‘播放失败’ )
}
});
一直走fail
我也遇到了先下载,在拿得到的地址去播放,确实走了success,但是完全没有声音啊,怎么破。有人解决了吗?
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”}