module for loading WebAudio buffers (and other loading utilities).
npm install [--save] waves-loaders
loading one file
import * as loaders from 'waves-loaders';
const loader = new loaders.AudioBufferLoader();
loader.onProgress(progress => console.log(progress));
// { value:.., total:..., loaded:... }
async function init() {
await buffer = loader.load('sound/file/url');
// do something with `buffer`
}
loading multiple files
import * as loaders from 'waves-loaders';
const loader = new loaders.AudioBufferLoader();
async function init() {
await buffers = loader.load(['sound/file-1', 'sound/file-1']);
// do something with `buffers[0]` and `buffers[1]`
}
This module is released under the BSD-3-Clause license.
This code is part of the WAVE project, funded by ANR (The French National Research Agency), ContInt program, 2012-2015.