mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-19 09:30:06 +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())
|
if (t1 >= clip->GetStartTime() && t0 <= clip->GetEndTime())
|
||||||
{
|
{
|
||||||
float cliprms;
|
float cliprms;
|
||||||
|
sampleCount clipStart, clipEnd;
|
||||||
|
|
||||||
if (it->GetData()->GetRMS(&cliprms, t0, t1))
|
if (it->GetData()->GetRMS(&cliprms, t0, t1))
|
||||||
{
|
{
|
||||||
sumsq += cliprms * cliprms * clip->GetNumSamples();
|
clip->TimeToSamplesClip(wxMax(t0, clip->GetStartTime()), &clipStart);
|
||||||
length += clip->GetNumSamples();
|
clip->TimeToSamplesClip(wxMin(t1, clip->GetEndTime()), &clipEnd);
|
||||||
|
sumsq += cliprms * cliprms * (clipEnd - clipStart);
|
||||||
|
length += (clipEnd - clipStart);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
result = false;
|
result = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user