0.1.3 • Published 8 years ago

@coleww/vocoder v0.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

Vocoder

This is a fork of Jamison Dance's port of Chris Wilson's Vocoder project with all the UI stripped out and modified to work with Browserify and also gives u more control over when and how the vocoding happens.

Basically, you can control the pitch of a vocal track. (ノ◕ヮ◕)ノ*:・゚✧ M A G I C AL (ಥ﹏ಥ)

Installation

npm install --save vocoder

Usage

###function vocoder(audioContext, carrierNode, modulatorBuffer, destination)

Setup a vocoder that will play the modulatorBuffer mixed in with the carrierNode (which is an audio node that is already making noise) through the destination. These are both AudioBuffers. Returns an object containing the generated audioNodes and a start(when) function which will play the vocoded sound at when.

Example

var vocoder = require('vocoder');
var load = require('webaudio-buffer-loader');

var ctx = new AudioContext();
var gain = ctx.createGain()

load(['/carrier.ogg', '/modulator.ogg'], ctx, function(err, buffers) {
  var itHasBeenVocoded = vocoder(ctx, buffers[0], buffers[1], gain)
  itHasBeenVocoded.start(ctx.currentTime)
});