Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/audiocontext-polyfill
Polyfill for 'AudioContext' of Web Audio API
https://github.com/shinnn/audiocontext-polyfill
Last synced: 26 days ago
JSON representation
Polyfill for 'AudioContext' of Web Audio API
- Host: GitHub
- URL: https://github.com/shinnn/audiocontext-polyfill
- Owner: shinnn
- License: mit
- Created: 2013-12-13T11:45:58.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-22T17:07:42.000Z (over 10 years ago)
- Last Synced: 2024-10-11T22:26:53.013Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 258 KB
- Stars: 25
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AudioContext-Polyfill
[![Bower version](https://badge.fury.io/bo/audiocontext-polyfill.png)](http://badge.fury.io/bo/audiocontext-polyfill)
[![devDependency Status](https://david-dm.org/shinnn/Audiocontext-polyfill/dev-status.png)](https://david-dm.org/shinnn/Audiocontext-polyfill#info=devDependencies)Polyfill for `AudioContext` and its parties on [Web Audio API](http://www.w3.org/TR/webaudio/ "Web Audio API W3C Working Draft")
## Installation
### Bower
Download via [Bower](http://bower.io/ "BOWER: A package manager for the web").
```
bower install --save audiocontext-polyfill
```Or add `audiocontext-polyfill` to the [`bower.json`](http://bower.io/#defining-a-package) of your project and run `bower install`.
```json
{
"dependencies": {
"audiocontext-polyfill": "latest"
}
{
```### Standalone
[Download the script file directly.](https://raw.github.com/shinnn/AudioContext-Polyfill/master/audiocontext-polyfill.js "view raw")
## Usage
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)`.
### Supported API
[ctx]:
[octx]:
[gain]:
[delay]:
[proc]:| Clean API name | deprecated or vendor-prefixed |
| ----------------------------- | ----------------------------- |
| [AudioContext][ctx] | webkitAudioContext |
| [OfflineAudioContext][octx] | webkitOfflineAudioContext |
| start | noteOn |
| stop | noteOff |
| [createGain][gain] | createGainNode |
| [createDelay][delay] | createDelayNode |
| [createScriptProcessor][proc] | createJavaScriptNode |## License
Copyright (c) 2013 - 2014 [Shinnosuke Watanabe](https://github.com/shinnn)
Licensed under [the MIT license](./LICENSE).