1
0
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:
martynshaw99 2014-05-13 23:36:39 +00:00
parent a1219080e1
commit 3d64971e90

View File

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