Variable rate controllable audio pitch shifter
Here is a simplified psuedo-example:
//Create a pitch shifting objectvar shifter = require"pitch-shift"//Play / write out frame. Called whenver data is readyconsole.log"Got pitch " pitch " at time " t//This is the amount to scale the sample byreturn 1.0//Feed some data to the shiftershifter1 1 0 1 0 0 0 /* ... etc */
For a more complete working example, check out test/test.js or example/index.js
npm install pitch-shift
Creates a pitch shifting function
onData(frame)Called when a pitch shifted frame is ready.
onTune(t, pitch)Called when a frame of audio needs to be processed.
optionsAn object full of options to pass to the pitch shifter
frameSizesize of frame to process (default
hopSizethe distance between frames in samples. Must divide frame size. (default
dataSizemaximal allowable size of a data frame (default
sampleRateConversion factor from samples to seconds. (default
analysiWindowanalysis window. must be a typed array with length equl to frame size (defaults to Hann window)
synthesisWindowsynthesis window. must be a typed array with length equal to frame size (defaults to Hann window)
thresholdpeak detection threshold. Set to 1.0 to always take maximum, otherwise set lower to detect half tones. (default
minPeriodMinimal resolvable period. (default
Returns A function that you call with a frame of data.
(c) 2013 Mikola Lysenko. MIT License
Gettysburg adress reading by Britton Rea. Recording obtained from the Internet archive. http://archive.org/details/GettysburgAddress