Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Latest commit

 

History

History
executable file
·
30 lines (19 loc) · 864 Bytes

README.md

File metadata and controls

executable file
·
30 lines (19 loc) · 864 Bytes

arraybuffer-to-audiobuffer

Convert ArrayBuffer to AudioBuffer

Install

npm install arraybuffer-to-audiobuffer

Usage

Pass ArrayBuffer as first argument.

Takes an optional AudioContext as second argument, otherwise it'll create a new AudioContext.

Returns Promise which resolves to AudioBuffer.

const arrayBufferToAudioBuffer = require('arraybuffer-to-audiobuffer')

arrayBufferToAudioBuffer(arrayBuffer, audioContext)
.then(audioBuffer => {
  // do something with AudioBuffer
})

License

MIT