webaudio-buffer-loader
v1.0.1
Published
Loads buffers using the webaudio api
Downloads
29
Readme
webaudio-buffer-loader
Little util for grabbing files from a server and loading them as AudioBuffers in a web audio context.
Installation
npm install webaudio-buffer-loader
Usage
var ctx = new AudioContext();
var loader = require('webaudio-buffer-loader');
var buffers = ['schiphol.mp3', 'what-time-taught-us.ogg', 'oxbow-b.wav'];
loader(buffers, ctx, function(err, loadedBuffers) {
// use yer buffers
});
The first argument can be an array of paths or a single path. If any of the requests to grab the file at a path fail, the cb will be called with the error.