Hi,
I can’t find any examples. When I use speedRatio = 1.0, everything seems to be fine. But if I want to use different speeds then I hear just crackles and my sine looks like 512 samples is sine and the rest is just zero values.
I asked chatgpt and after two hours we come with it. But it still not working as expected:
// prepareSample:
float inputSample[2048]{}; // sine
float output[bufferSize]; // size equals to the buffer size. Basically 512 or 1024.
juce::LinearInterpolator interpolator;
...
// render next block:
double speedRatio = 2.0;
auto sampleSize = 2048;
auto increment = interpolator.process(speedRatio, inputSample, outputSamples, bufferSize, sampleSize, 1);
position += increment; // increment for some reason always 0 why?!?!
if (position >= sampleSize) {
position -= sampleSize;
interpolator.reset();
}