1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-16 08:34:10 +02:00
modified version of Martyn's patch
This commit is contained in:
v.audacity 2012-07-11 04:09:45 +00:00
parent bbee41ab67
commit 002b25991d

View File

@ -1752,15 +1752,15 @@ void WaveTrack::GetEnvelopeValues(double *buffer, int bufferLen,
if (rt0 < clip->GetStartTime()) if (rt0 < clip->GetStartTime())
{ {
int dx = (int) floor((clip->GetStartTime() - rt0) / tstep + 0.5); sampleCount start = clip->GetStartSample();
rbuf += dx; rbuf += start;
rlen -= dx; rlen -= start;
rt0 = clip->GetStartTime(); rt0 = clip->GetStartTime();
} }
if (rt0+rlen*tstep > clip->GetEndTime()) if (rt0+rlen*tstep > clip->GetEndTime())
{ {
rlen = (int) ((clip->GetEndTime()-rt0) / tstep); rlen = clip->GetEndSample() - clip->GetStartSample();
} }
clip->GetEnvelope()->GetValues(rbuf, rlen, rt0, tstep); clip->GetEnvelope()->GetValues(rbuf, rlen, rt0, tstep);
} }