Merge pull request #732 from paulfd/padding-frames

If the voice just started, output from the first source sample
This commit is contained in:
Paul Ferrand 2021-03-21 20:08:16 +01:00 committed by GitHub
commit 77a83561cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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_;