If the voice just started, output from the first source sample

This commit is contained in:
Paul Fd 2021-03-21 18:19:26 +01:00
parent ce0a4df29f
commit 6a765a78c5

View file

@ -927,6 +927,11 @@ void Voice::Impl::fillWithData(AudioSpan<float> buffer) noexcept
return;
fill(*jumps, pitchRatio_ * speedRatio_);
// Take the first sample if the voice just started
if (age_ == 0)
jumps->front() = 0.0f;
pitchEnvelope(*jumps);
jumps->front() += floatPositionOffset_;