fetch-as-audio-buffer
v0.10.1
Published
util function to fetch audio buffer
Downloads
6
Maintainers
Readme
fetchAsAudioBuffer
util function to fetch audio buffer
Installation
npm install fetch-as-audio-buffer
downloads:
API
fetchAsAudioBuffer(audioContext, url): any
audioContext: AudioContext
url: string
url 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