GithubHelp home page GithubHelp logo

kerfoffle / webkitaudiocontext-monkeypatch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cwilso/webkitaudiocontext-monkeypatch

0.0 2.0 0.0 446 KB

Monkey-patching library to make apps using deprecated Web Audio syntax work in conforming implementations.

webkitaudiocontext-monkeypatch's Introduction

webkitAudioContext monkeypatch

This monkeypatch library is intended to be included in projects that use webkitAudioContext (instead of AudioContext), and that may use the now- deprecated bits of the Web Audio API (e.g. using AudioBufferSourceNode.noteOn() instead of AudioBufferSourceNode.start().

This library should be harmless to include if the browser does not have the unprefixed "AudioContext" implemented. If unprefixed AudioContext is supported, but the deprecated method names are already implemented, this library will have created a few shim functions on create* methods, but will not damage or override anything else. It also will not take effect if webkitAudioContext is implemented.

Ideally, the use of this library will go to zero - it is only intended as a way to quickly get script written to the old Web Audio methods to work in browsers that only support the new, approved methods.

The patches this library handles:

  • AudioBufferSourceNode.noteOn() is aliased to start()
  • AudioBufferSourceNode.noteGrainOn() is aliased to start()
  • AudioBufferSourceNode.noteOff() is aliased to stop()
  • AudioContext.createGainNode() is aliased to createGain()
  • AudioContext.createDelayNode() is aliased to createDelay()
  • AudioContext.createJavaScriptNode() is aliased to createScriptProcessor()
  • OscillatorNode.noteOn() is aliased to start()
  • OscillatorNode.noteOff() is aliased to stop()
  • AudioParam.setTargetValueAtTime() is aliased to setTargetAtTime()
  • OscillatorNode's old enum values are aliased to the Web IDL enum values.
  • BiquadFilterNode's old enum values are aliased to the Web IDL enum values.
  • PannerNode's old enum values are aliased to the Web IDL enum values.
  • AudioContext.createWaveTable() is aliased to createPeriodicWave().
  • OscillatorNode.setWaveTable() is aliased to setPeriodicWave().

You can copy the webkitAudioContextMonkeyPatch.js into your project if you like, or include it as http://cwilso.github.com/webkitAudioContext-MonkeyPatch/webkitAudioContextMonkeyPatch.js.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.