playvoice 播放成功但是没声音
发布于 7 年前 作者 yaoqiang 3974 次浏览 来自 问答

wx.downloadFile({

url:“http://123.206.192.155/files/music/341_002_01.mp3”,

success:function(res){

wx.playVoice({

filePath: res.tempFilePath,

success:function(e){

console.log(res.tempFilePath)

console.log(e)

},

fail: function () {

console.log(“播放失败”)

}

})

}

})

这是代码

日志:

{tempFilePath: “wxfile://tmp_250646293o6zAJs779AehKefPJq2Gl_1PFov498d192d8a1f33a9e337274a935febea6.mp3”, statusCode: 200, errMsg: “downloadFile:ok”}

lesson1.js? [sm]:110 {errMsg: “playVoice:ok”}

都是ok的,就是没声音,有大神来解答下

2 回复

1.播放录音的话得用真机

2.用

wx.createInnerAudioContext()

替代:wx.playVoice

https://developers.weixin.qq.com/miniprogram/dev/api/createInnerAudioContext.html

解决了吗?

回到顶部