< Promise > decodeAudioData
Promise-based decodeAudioData for legacy Web Audio API
http://webaudio.github.io/web-audio-api/#AudioContext-decodeAudioData
Native API supports
Support | |
---|---|
Google Chrome 43 | |
Opera 30 | |
Firefox 36 | |
Safari 8 | |
iOS 8 |
Installation
npm:
npm install promise-decode-audio-data
bower:
bower install promise-decode-audio-data
downloads:
In a browser:
<script src="/path/to/promise-decode-audio-data.js"></script>
API
AudioContext.prototype.decodeAudioData(audioData: ArrayBuffer): Promise<AudioBuffer>
Example
var audioContext = new AudioContext();
audioContext.decodeAudioData(audioData).then(function(decodedData) {
// use the decoded data here
});
Development
build: browserify -> uglify
npm run build
test: mocha
(and Online test suite)
npm run test
lint: jshint
npm run lint
License
MIT