howler-plugin-effect-chain
Adds 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 Sound
s and the Howler.masterGain
:
Sound._node -> Howler._effectChain -> [Added effects] -> Howler._effectChainOut -> Howler.masterGain
Installation
Via npm
First, install it.
npm i -S howler-plugin-effect-chain
Now import it.
// ES6 imports // CommonJS importsvar howler =
Via script tag
Save src/index.js
as howler-plugin-effect-chain.js
(or whatever you want to call it) and add a <script>
tag after the core Howler library.
API
Howler.addEffect(effect)
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.
const tuna = Howlerctxconst chorus = {} Howler
Howler.removeEffect(effect)
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.
Howler