安卓createInnerAudioContext播放不了aac格式语音
发布于 6 年前 作者 shenyan 9853 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)
  • 预期表现

安卓音频播放10004

  • 复现路径

pages/index/index

  • 提供一个最简复现 Demo
Page({
  data: {
    innerAudioContext:null
  },
  onLoad (options) {
    //创建音频
    this.innerAudioContext = wx.createInnerAudioContext()
    this.innerAudioContext.onError((res) => {
      console.log(res)
    })
  },
  play () {
    let src = "https://img.hyqfx.com/u/content/2018/0926/1423238690.aac"
    if (this.innerAudioContext.paused){
      this.innerAudioContext.src = src;
      this.innerAudioContext.play()
    }
  }
})
3 回复

https://developers.weixin.qq.com/community/develop/doc/000e0a2828c0b814b6c636ce351800

详细见此贴噢,建议先转成支持的音频格式规避这个问题。

10004是指格式错误,应该就是不标准的格式导致的不兼容问题

我播放刚录音的文件也不行?

回到顶部