从腾讯云端下载的wav文件保存在本地有时无法播放?
发布于 6 年前 作者 yanglong 13403 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)

从腾讯云端下载的wav文件保存在本地有时无法播放?体验版,开发版都会出现没声音的情况。有时又可以播放。

  • 预期表现

点播放按钮就播放出声音

  • 复现路径

保存:

wx.saveFile({

tempFilePath: res.tempFilePath,

success (res1) {

  const savedFilePath = res1.savedFilePath

  wx.setStorage({

key: savedname,

data: savedFilePath

  })

  console.log(savedname)

},

fail (res2) {

  console.log(res2.errMsg)

}

})

播放:

const innerAudioContext = wx.createInnerAudioContext()

innerAudioContext.autoplay = true

innerAudioContext.obeyMuteSwitch = false

wx.getStorage({

key: stKey,

success (res) {

  console.log(res.data)

  innerAudioContext.src = res.data

  innerAudioContext.play()

}

})

  • 提供一个最简复现 Demo
2 回复

wxfile://store_xxxx…d6b6fd8a5150708b98a0caae.unknown

main.js? [sm]:2867 errCode:602, err:error, not found param

main.js? [sm]:2868 10001

回到顶部