Hi there. I have some problems with changing tempo, pitch and rate of playing song,
I have two instance of soundtouch, for both left and right audio channels. Here the related code in prepareToPlay method in my project:
soundTouchL = soundtouch_createInstance();
soundtouch_setChannels(soundTouchL,1);
soundtouch_setSampleRate(soundTouchL, (int)sampleRate);
soundTouchR = soundtouch_createInstance();
soundtouch_setChannels(soundTouchR, 1);
soundtouch_setSampleRate(soundTouchR, (int)sampleRate);
And the code in ProcessBlock:
float* dataL = buffer.getWritePointer(0);
float* dataR = buffer.getWritePointer(1);
soundtouch_setRateChange(soundTouchL, deltaRate);
soundtouch_putSamples(soundTouchL, dataL, buffer.getNumSamples());
soundtouch_receiveSamples(soundTouchL, dataL, buffer.getNumSamples());
soundtouch_setRateChange(soundTouchR, deltaRate);
soundtouch_putSamples(soundTouchR, dataR, buffer.getNumSamples());
soundtouch_receiveSamples(soundTouchR, dataR, buffer.getNumSamples());
deltaRate value is changed by slider and it has a range between -50.0 and 50.0.
Tempo, rate and pitch changing don’t work properly while increasing deltaRate value (between 0 and 50) for me. So I have problems with changing deltaRate to positive. Can anyone help about how to fix that?