微信8.0.34开始wx.createWebAudioContext() 播放音频中断
播放音频在15秒以内中断,最长不超过16秒,需要真机测试
const audioContext = wx.createWebAudioContext()
const base64 = wx.getFileSystemManager().readFileSync("/assets/xx.wav", "base64")
const buffer = wx.base64ToArrayBuffer(base64)
audioContext.decodeAudioData(buffer, (audioBuffer) => {
let audioSource = audioContext.createBufferSource()
audioSource.buffer = audioBuffer
audioSource.loop = true
audioSource.connect(audioContext.destination)
audioSource.start()
})