mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
FFTSimpleExample: avoid an assertion when the input audio is a block of samples all of which are exactly zero
This commit is contained in:
parent
ade10c9328
commit
8433b3799d
1 changed files with 1 additions and 1 deletions
|
|
@ -124,7 +124,7 @@ public:
|
|||
{
|
||||
const float skewedProportionY = 1.0f - std::exp (std::log (y / (float) imageHeight) * 0.2f);
|
||||
const int fftDataIndex = jlimit (0, fftSize / 2, (int) (skewedProportionY * fftSize / 2));
|
||||
const float level = jmap (fftData[fftDataIndex], 0.0f, maxLevel.getEnd(), 0.0f, 1.0f);
|
||||
const float level = jmap (fftData[fftDataIndex], 0.0f, jmax (maxLevel.getEnd(), 1e-5f), 0.0f, 1.0f);
|
||||
|
||||
spectrogramImage.setPixelAt (rightHandEdge, y, Colour::fromHSV (level, 1.0f, level, 1.0f));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue