decode audio fail
发布于 5 年前 作者 yangchang 664 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)

.mp3音频文件播放到一半的时候报错,错误信息:errCode:1001 errMsg: ‘errCode67,err:decode audio fail’

尝试过在线播放和下载后播放,都会报错

  • 预期表现

正常播放

  • 复现路径

使用MIX 2S必现

  • 提供一个最简复现 Demo

const app = getApp()

Page({

data: {

innerAudioContext: null

},

onShow: function() {

this.data.innerAudioContext && this.data.innerAudioContext.stop()

this.data.innerAudioContext && this.data.innerAudioContext.play()

},

onLoad: function () {

const innerAudioContext = wx.createInnerAudioContext()

innerAudioContext.src = https://xcx-cdn-ali.kaochong.com/hearing/voice_url/voice_url-1550566505778.mp3

innerAudioContext.onPlay(() => {

console.log(‘开始播放’)

})

innerAudioContext.onError((res) => {

console.log(res.errMsg)

console.log(res.errCode)

})

this.setData({

innerAudioContext: innerAudioContext

})

}

})

回到顶部