Package Exports
- fetch-as-audio-buffer
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fetch-as-audio-buffer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
fetchAsAudioBuffer
util function to fetch audio buffer
Installation
npm install fetch-as-audio-bufferdownloads:
API
fetchAsAudioBuffer(audioContext, url): anyaudioContext: AudioContexturl: stringurl of target file - returnsPromise<AudioBuffer>url: string[]case of multiple targets - returnsPromise<AudioBuffer[]>
Usage
var audioContext = new AudioContext();
fetchAsAudioBuffer(audioContext, "amen.wav").then(function(result) {
console.log(result); // result is AudioBuffer
});var audioContext = new AudioContext();
fetchAsAudioBuffer(audioContext, [ "bd.wav", "sd.wav", "hh.wav" ]).then(function(result) {
console.log(result); // result is Array of AudioBuffer
});License
MIT