Adds an audio effect chain to Howler
npm install howler-plugin-effect-chainAdds an audio effect chain to Howler. Suitable as bridge between Howler and web audio libraries such as Tuna.
It works by injecting a chain of nodes between Sounds and the Howler.masterGain:
```
Sound._node -> Howler._effectChain -> [Added effects] -> Howler._effectChainOut -> Howler.masterGain
First, install it.
`js`
npm i -S howler-plugin-effect-chain
Now import it.
`js
// ES6 imports
import { Howler, Howl } from 'howler'
import 'howler-plugin-effect-chain'
// CommonJS imports
var howler = require('howler')
require('howler-plugin-effect-chain')
`
Save src/index.js as howler-plugin-effect-chain.js (or whatever you want to call it) and add a
`
Adds an effect to the effect chain. The effect object must function like an AudioNode, exposing a connect and disconnect method.
Here's an example using the Tuna library.
`js
import { Howler } from 'howler'
import Tuna from 'tunajs'
const tuna = new Tuna(Howler.ctx)
const chorus = new tuna.Chorus({})
Howler.addEffect(chorus)
`
Removes an effect from the effect chain. The passed effect object must have been previously added using Howler.addEffect(effect).
Here's an example removing the chorus from the previous example.
`js``
Howler.removeEffect(chorus)