mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-30 15:49:41 +02:00
Steve 'the Fiddle' Daulton's fix for a little bug I wrote about 6 years ago. Thanks Steve!
This commit is contained in:
parent
a1219080e1
commit
3d64971e90
@ -1713,10 +1713,14 @@ bool WaveTrack::GetRMS(float *rms, double t0, double t1)
|
||||
if (t1 >= clip->GetStartTime() && t0 <= clip->GetEndTime())
|
||||
{
|
||||
float cliprms;
|
||||
sampleCount clipStart, clipEnd;
|
||||
|
||||
if (it->GetData()->GetRMS(&cliprms, t0, t1))
|
||||
{
|
||||
sumsq += cliprms * cliprms * clip->GetNumSamples();
|
||||
length += clip->GetNumSamples();
|
||||
clip->TimeToSamplesClip(wxMax(t0, clip->GetStartTime()), &clipStart);
|
||||
clip->TimeToSamplesClip(wxMin(t1, clip->GetEndTime()), &clipEnd);
|
||||
sumsq += cliprms * cliprms * (clipEnd - clipStart);
|
||||
length += (clipEnd - clipStart);
|
||||
} else
|
||||
{
|
||||
result = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user