Remove unneeded isnan checks

These values would only be nan if the dft yielded nans.
This should never happen as long as the sound input isn't something
weird, like nan or +-inf.
This commit is contained in:
Erik Präntare
2022-04-09 03:05:09 +02:00
committed by Kai Blaschke
parent e1832f20f5
commit 15d2aa61bc

View File

@ -91,19 +91,6 @@ void BeatDetect::CalculateBeatStatistics()
treb = trebInstant / std::max(0.0001f, trebSmoothed.Get());
vol = volInstant / std::max(0.0001f, volSmoothed.Get());
if (std::isnan(treb))
{
treb = 0.0;
}
if (std::isnan(mid))
{
mid = 0.0;
}
if (std::isnan(bass))
{
bass = 0.0;
}
trebAtt = .6f * trebAtt + .4f * treb;
midAtt = .6f * midAtt + .4f * mid;
bassAtt = .6f * bassAtt + .4f * bass;