Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including soundbank-reverb with all npm packages installed. Try it out:

var soundbankReverb = require("soundbank-reverb")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

soundbank-reverb v1.1.2

Simple Web Audio API based reverb effect.

soundbank-reverb

Simple Web Audio API based reverb effect.

Based on https://github.com/web-audio-components/simple-reverb by Nick Thompson.

Intended for use as a processor in soundbank, but it is compatible with any Web Audio API AudioNode set up.

Install via npm

$ npm install soundbank-reverb

API

var Reverb = require('soundbank-reverb')

var reverb = Reverb(audioContext)

Pass an instance of AudioContext to the constructor to create an AudioNode.

reverb.wet AudioParam

reverb.dry AudioParam

reverb.cutoff AudioParam

Defaults to 20000.

reverb.filterType (get/set)

Defaults to "lowpass".

Can be any of the filters types specified by BiquadFilterNode

reverb.time (get/set)

Impulse time in seconds. Defaults to 3.

reverb.decay (get/set)

reverb.reverse (get/set)

true or false. Defaults to false.

Example

var Reverb = require('soundbank-reverb')

var audioContext = new AudioContext()

var reverb = Reverb(audioContext)
reverb.connect(audioContext.destination)

reverb.time = 1 //seconds
reverb.wet.value = 0.8
reverb.dry.value = 1

reverb.filterType = 'lowpass'
reverb.cutoff.value = 4000 //Hz

setInterval(function(){
  var source = audioContext.createOscillator()
  source.type = 'sawtooth'
  source.connect(reverb)
  source.start()
  source.stop(audioContext.currentTime + 0.5)
}, 2000)
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free