soundtouch-js
soundtouch-js copied to clipboard
JavaScript audio time-stretching and pitch-shifting library
#soundtouch.js
JavaScript audio time-stretching and pitch-shifting library. Based on the C++ implementation of [SoundTouch](http://www.surina.net/soundtouch/ soundtouch).
Built by Ryan Berdeen. getWebAudioNode utility written by Adrian Holovaty. User-friendly PitchShifter wrapper by fiala.
##Setup
- Include
soundtouch.min.jsin your HTML, orrequire('soundtouch-js')in Node (Node implementation is incomplete!).
##Usage
- In order to run PitchShifter, you need a loaded and decoded
AudioBuffer - After the buffer has been decoded, e.g. in the callback of
AudioContext.decodeAudioData, create a newPitchShifteras follows
//instantiate pitchshifter
pitchshifter = new PitchShifter(context, buffer, 1024);
//set pitch/tempo
pitchshifter.tempo = 0.75;
pitchshifter.pitch = 2;
- to begin playback, connect the
PitchShifterto the WebAudio destination (or another node), and disconnect it to pause. - note that
PitchShifteris a pseudo-node, and cannot be connected to.