# AudioBuffer WebAudioContext.decodeAudioData()

with Promise style call: Not supported

Mini Program plugin: Not supported

Asynchronously decodes a resource as an AudioBuffer.

# Return value

# AudioBuffer

# sample code

Example


wx.request({
  url: url, // audio frequency url
  responseType: 'arraybuffer',
  success: res => {
    audioCtx.decodeAudioData(res.data, buffer => {
      console.log(buffer)
    }, err => {
      console.error('decodeAudioData fail', err)
    })
  }
})