- 当前 Bug 的表现(可附上截图)
- 预期表现
- 复现路径
- 提供一个最简复现 Demo
音频下载地址:
http://ischool.h3c.com:9008/e930c5da-3c37-4659-bfba-7abd4b122833.aac
报错信息:
{errCode: 10004, errMsg: "errCode:55, err:unknow format"}
代码段:
console.log(“检测到点击”)
let that = this
let name = e.currentTarget.dataset.id
let host = api.AudioDownload + name
let url = “http://ischool.h3c.com:9008/e930c5da-3c37-4659-bfba-7abd4b122833.aac”//host
audio.src = url
audio.startTime = 0
audio.autoplay = false
audio.loop = false
audio.obeyMuteSwitch = false
audio.volume = 1
//wx.setInnerAudioOption({obeyMuteSwitch:false});
console.log(“监测点2”, audio.src, audio.obeyMuteSwitch, audio.autoplay, audio.volume, audio)
if (!that.data.voiceProcessing) {
console.log(“监测点3”)
audio.play()
audio.onCanplay(() => {
console.log(“监听音频进入可以播放状态的事件。但不保证后面可以流畅播放”)
})
audio.onWaiting(()=>{
// debugger
console.log(“start waiting”);
})
audio.onError((res) => {
console.log(“error”,res);
console.log(“监听音频播放错误事件”)
})
audio.onPlay(
() => {
debugger
console.log(“监听到Play”)
that.setData({
voiceProcessing: true
})
}
)
audio.onEnded(
() => {
console.log(“监听到end”)
that.setData({
voiceProcessing: false
})
}
)
} else {
audio.pause()
audio.onPause(
() => {
audio.onPause(() => {
console.log(“监听音频暂停事件”)
})
that.setData({
voiceProcessing: false
})
}
)
}
请各位帮忙看下!