• Stars
    star
    144
  • Rank 255,590 (Top 6 %)
  • Language
    JavaScript
  • Created over 11 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Monkeypatch to use proper AudioContext naming on prefixed/deprecated named systems.

AudioContext monkeypatch

This monkeypatch library is intended to be included in projects that are written to the proper AudioContext spec (instead of webkitAudioContext), and that use the new naming and proper bits of the Web Audio API (e.g. using BufferSourceNode.start() instead of BufferSourceNode.noteOn()), but may have to run on systems that only support the deprecated bits.

This library should be harmless to include if the browser supports unprefixed "AudioContext", and/or if it supports the new names.

The patches this library handles:

if window.AudioContext is unsupported, it will be aliased to webkitAudioContext(). if AudioBufferSourceNode.start() is unimplemented, it will be routed to noteOn() or noteGrainOn(), depending on parameters.

The following aliases only take effect if the new names are not already in place:

  • AudioBufferSourceNode.stop() is aliased to noteOff()
  • AudioContext.createGain() is aliased to createGainNode()
  • AudioContext.createDelay() is aliased to createDelayNode()
  • AudioContext.createScriptProcessor() is aliased to createJavaScriptNode()
  • AudioContext.createPeriodicWave() is aliased to createWaveTable()
  • OscillatorNode.start() is aliased to noteOn()
  • OscillatorNode.stop() is aliased to noteOff()
  • AudioParam.setTargetAtTime() is aliased to setTargetValueAtTime()
  • OscillatorNode.setPeriodicWave() is aliased to setWaveTable()

This library does NOT patch the enumerated type changes, as it is recommended in the specification that implementations support both integer and string types for AudioPannerNode.panningModel, AudioPannerNode.distanceModel BiquadFilterNode.type and OscillatorNode.type.

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

More Repositories

1

PitchDetect

Pitch detection in Web Audio using autocorrelation
JavaScript
1,295
star
2

midi-synth

A MIDI-driven Web Audio synthesizer
HTML
584
star
3

metronome

Web Audio metronome example to show scheduling.
JavaScript
576
star
4

Audio-Input-Effects

Live input Web Audio effects
JavaScript
539
star
5

WebAudio

Web Audio API Playground
JavaScript
492
star
6

volume-meter

Simple example of implementing a clip-detecting volume meter in Web Audio.
JavaScript
425
star
7

AudioRecorder

Simple live audio file recorder, based on RecorderJS
JavaScript
420
star
8

WebMIDIAPIShim

Polyfill using the Jazz NPAPI MIDI plugin to implement the Web MIDI API on Mac and Windows.
JavaScript
380
star
9

Vocoder

Naive WebAudio Vocoder
JavaScript
341
star
10

MIDIDrums

MIDI version of Shiny Drum Machine
JavaScript
339
star
11

wubwubwub

Audio experiments
JavaScript
95
star
12

webkitAudioContext-MonkeyPatch

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

monosynth

A monophonic Web Audio synthesizer driven by Web MIDI
HTML
45
star
14

Audio-Buffer-Draw

Draws a Web Audio AudioBuffer to a canvas
JavaScript
43
star
15

web-audio-samples

Port of http://chromium.googlecode.com/svn/trunk/
31
star
16

Standard-MIDI-File-reader

A test JS/HTML app to decode Standard MIDI Files
JavaScript
29
star
17

SynthTemplate

Synthesizer template
JavaScript
26
star
18

webaudiodemos

source for webaudiodemos
JavaScript
25
star
19

conway

Conway's Game of Life
JavaScript
25
star
20

Drumr

Drumpad/drum machine project.
JavaScript
8
star
21

SMFPlayer

MIDI reader/sequencer
JavaScript
8
star
22

WebAudioSlides

CSS
7
star
23

webmusicplatform

Platform for creating Web Music
CSS
7
star
24

Lupr

Looping metronome/sampler/sequencer/appegiator
JavaScript
5
star
25

AmazonTV

Prototype Amazon interface for TV
JavaScript
4
star
26

TestRecorder

JavaScript
3
star
27

badmetronome

The WRONG way to implement timing for audio applications.
JavaScript
3
star
28

life

temp project
JavaScript
3
star
29

testpages

CSS
2
star
30

AC2023

AC2023 slides
HTML
2
star
31

TPAC_incubation

HTML
1
star