GithubHelp home page GithubHelp logo

kaibadash / howler-plugin-effect-chain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexanderwallin/howler-plugin-effect-chain

0.0 1.0 0.0 7 KB

Adds an audio effect chain to Howler

JavaScript 100.00%

howler-plugin-effect-chain's Introduction

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 Sounds 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
import { Howler, Howl } from 'howler'
import 'howler-plugin-effect-chain'

// CommonJS imports
var howler = require('howler')
require('howler-plugin-effect-chain')

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.

<script src="howler.min.js"></script>
<script src="howler-plugin-effect-chain.js"></script>

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.

import { Howler } from 'howler'
import Tuna from 'tunajs'

const tuna = new Tuna(Howler.ctx)
const chorus = new tuna.Chorus({})

Howler.addEffect(chorus)

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.removeEffect(chorus)

howler-plugin-effect-chain's People

Contributors

alexanderwallin avatar

Watchers

James Cloos avatar

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.