Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 1.04 KB

README.md

File metadata and controls

46 lines (35 loc) · 1.04 KB

web-audio-extended

Include the script in your HTML:

<script src="AudioContextExtended.js"></script>

Create an audio context:

const audioContext = new AudioContextExtended();

Create and connect components:

const audioContext = new AudioContextExtended();

const eq = audioContext.createThreeBandEqualizer();
const reverb = audioContext.createReverbEffect();

mySource.connect(eq).connect(reverb).connect(audioContext.destination);

Simplify effects chains:

const audioContext = new AudioContextExtended();

const eq = audioContext.createThreeBandEqualizer();
const chorus = audioContext.createChorusEffect();
const delay = audioContext.createDelayEffect();
const reverb = audioContext.createReverbEffect();
const vinyl = audioContext.createVinylEffect();

const effectsChain = audioContext.createEffectsChain([
  eq,
  chorus,
  delay,
  reverb,
  vinyl
]);

mySource.connect(effectsChain).connect(audioContext.destination);

...

effectsChain.toggleBypass(chorus); // toggle effects on demand