Polyfill for AudioContext
and its parties on Web Audio API
Download via Bower.
bower install --save audiocontext-polyfill
Or add audiocontext-polyfill
to the bower.json
of your project and run bower install
.
{
"dependencies": {
"audiocontext-polyfill": "latest"
}
{
Download the script file directly.
Load audiocontext-polyfill.js
before any scripts else related to Web Audio API.
After it loaded, you can use Web Audio API without any vendor prefixes or deprecated methods.
For example, you can create an audio context with new AudioContext()
instead of new webkitAudioContext()
, or play sounds with .start(0)
instead of old API .noteOn(0)
.
Clean API name | deprecated or vendor-prefixed |
---|---|
AudioContext | webkitAudioContext |
OfflineAudioContext | webkitOfflineAudioContext |
start | noteOn |
stop | noteOff |
createGain | createGainNode |
createDelay | createDelayNode |
createScriptProcessor | createJavaScriptNode |
Copyright (c) 2013 - 2014 Shinnosuke Watanabe
Licensed under the MIT license.