# \[EDIT\]Question about SpectrogramComponent in SimpleFFTExample

**URL:** <https://forum.juce.com/t/edit-question-about-spectrogramcomponent-in-simplefftexample/14900>\
**Category:** General JUCE discussion\
**Created:** [May 12, 2015, 5:40pm UTC](https://forum.juce.com/t/edit-question-about-spectrogramcomponent-in-simplefftexample/14900 "2015-05-12T17:40:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hb1](https://avatars.discourse-cdn.com/v4/letter/h/e36b37/32.png) [@hb1](https://forum.juce.com/u/hb1)\
**Post date:** [May 12, 2015, 5:40pm UTC](https://forum.juce.com/t/edit-question-about-spectrogramcomponent-in-simplefftexample/14900/1 "2015-05-12T17:40:49Z")

</div>

Hi, Jules and every one!&nbsp;I'm newby to develop&nbsp;GUI and Multi-Thread...

I want to create AudioVisualizer, so&nbsp;I'm trying to learn&nbsp;example codes.

&nbsp;

Then&nbsp;I have a question about&nbsp;SpectrogramComponent.&nbsp;(&nbsp;in&nbsp;SimpleFFTExample project )

I feel that SpectrogramComponent may drop&nbsp;audio data&nbsp;when pushNextSampleIntoFifo() is called&nbsp;from AudioThread.

&nbsp;

Is this&nbsp;right...??

SpectrogramComponent.h &nbsp;Line:72

```
void pushNextSampleIntoFifo (float sample) noexcept{ // if the fifo contains enough data, set a flag to say // that the next line should now be rendered.. if (fifoIndex == fftSize) { if (! nextFFTBlockReady) { zeromem (fftData, sizeof (fftData)); memcpy (fftData, fifo, sizeof (fifo)); nextFFTBlockReady = true; } **else { //sometimes come here. //Does that mean this drop fifo AudioData because TimerThread is drawing???" }** fifoIndex = 0; } fifo[fifoIndex++] = sample; }
```

Please give me any&nbsp;suggestion & approach... : (

&nbsp;

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [June 9, 2015, 7:28am UTC](https://forum.juce.com/t/edit-question-about-spectrogramcomponent-in-simplefftexample/14900/2 "2015-06-09T07:28:06Z")

</div>

I believe that when&nbsp;`nextFFTBlockReady `is true it just means that the last block hasn't drawn yet. This will happen if your timer didn't fire often enough. However, in principle, it should be fine to call&nbsp;`pushNextSampleIntoFifo `from the audio thread.

---

<div class="post-metadata">

**Author:** ![petah](https://avatars.discourse-cdn.com/v4/letter/p/e95f7d/32.png) [@petah](https://forum.juce.com/u/petah)\
**Post date:** [June 9, 2015, 11:14am UTC](https://forum.juce.com/t/edit-question-about-spectrogramcomponent-in-simplefftexample/14900/3 "2015-06-09T11:14:10Z")

</div>

note that SpectrogramComponent always scales its output to the FFT frame's min/max values; if you intend to display something less abstract like a stable freq EQ there is a \*lot\* more work involved. Ping me if you'd like more info.

cheers,

-- p
