You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using resampler::MultiChannelResampler to simulate pitch shift with duration modification on small audio clips (piano). It works well when I instantiate a new resampler every time I want to play a note, but I would like to avoid this overhead and reuse the resampler instance. However, whenever I reuse it, I hear a click/pop at the beginning of playback, which is probably due to the resampler still having leftover data from the last use (playback can be stopped before the clip finishes completely). I would like to know if there is a way to clear the internal data of a resampler without needing to instantiate a new one.
int outputFramesLeft = numOutputFrames;
while (outputFramesLeft > 0) {
if(resampler->isWriteNeeded()) {
const float *frame = getNextInputFrame(); // you provide this
resampler->writeNextFrame(frame);
} else {
resampler->readNextFrame(outputBuffer);
outputBuffer += channelCount;
outputFramesLeft--;
}
}
After using this resampler, which can stop being filled at any moment (when releasing the piano key), I want to reassign it to a new note that is pressed. However, when using the same instance, a click/pop occurs in the first frames of the new audio clip, which I imagine is due to leftover data from its last use. Therefore, I would like to know how to clear the resampler so it can be reused without this issue.
The text was updated successfully, but these errors were encountered:
I am using
resampler::MultiChannelResampler
to simulate pitch shift with duration modification on small audio clips (piano). It works well when I instantiate a new resampler every time I want to play a note, but I would like to avoid this overhead and reuse the resampler instance. However, whenever I reuse it, I hear a click/pop at the beginning of playback, which is probably due to the resampler still having leftover data from the last use (playback can be stopped before the clip finishes completely). I would like to know if there is a way to clear the internal data of a resampler without needing to instantiate a new one.I use the example from the Oboe resampler doc. So, when I press a key, the resampler is filled with frames, and I wait for the resampler's output when this happens. As here: https://github.com/google/oboe/tree/main/src/flowgraph/resampler
After using this resampler, which can stop being filled at any moment (when releasing the piano key), I want to reassign it to a new note that is pressed. However, when using the same instance, a click/pop occurs in the first frames of the new audio clip, which I imagine is due to leftover data from its last use. Therefore, I would like to know how to clear the resampler so it can be reused without this issue.
The text was updated successfully, but these errors were encountered: