arraybuffer-to-audiobuffer
v0.0.5
Published
Convert ArrayBuffer to AudioBuffer
Downloads
441
Maintainers
Readme
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