android下录制的音频,在ios可以播放,android小程序端无法播放
发布于 6 年前 作者 yong37 10483 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)
  • 预期表现
  • 复现路径
  • 提供一个最简复现 Demo

音频下载地址:

http://ischool.h3c.com:9008/e930c5da-3c37-4659-bfba-7abd4b122833.aac

报错信息:

  1. {errCode10004errMsg"errCode:55, err:unknow format"}

    1. errCode:10004

    2. errMsg:"errCode:55, err:unknow format"

    3. __proto__:Object

PAR-AL00armeabi-v7a

28

7.0.3

2.6.3 [234]

409ms

Wi-Fi

代码段:

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

})

}

)

}

请各位帮忙看下!

回到顶部