ref:ttp://blogs.zynaptiq.com/bernsee/pitch-shifting-using-the-ft/
void smbPitchShift(float pitchShift, long numSampsToProcess, long fftFrameSize, long osamp, float sampleRate, float *indata, float *outdata)
{
fft变换之后将频域值左右移动,向左是低频音,向右是高频音。
再ifft逆变回来。
}
api实例demo frame->data为pcm数据
float tmpbuf[1024] = {0};
long semitones = 6; // shift up by 3 semitones
float pitchShift = pow(2., semitones/12.); // convert semitones to factor
charlie_short_to_float(frame->data,tmpbuf,frame->samples);
smbPitchShift(pitchShift,frame->samples,2048,4,frame->rate,tmpbuf,tmpbuf);
charlie_float_to_short(tmpbuf,frame->data,frame->samples);