Is there any module that could show the levels of signal in juce GUI application?
and whether such module could be easily added to the MainComponent like the “slider” and “button” module?
The LevelMeter of juce is strangely hidden in AudioDeviceSelectorComponent.
If you consider third party modules, I wrote a free to use (BSD license) component:
You can measure AudioBuffers and connect a Component to it, that will reflect the meter in RMS and max, including a peak numeric indicator and an over LED.

I am a newer for c++ gui development. Is there easy operation module that like add a slider to MainCompionent? This is seems complex:grinning:
hi Daniel, can I use your module also in GUI Application? or just plugins?
Thanks
That should work, it is not linked to the AudioProcessor in any way
Hello Daniel,
I tried to write my get next audio block this way to get the meter working, but I still get nothing, what am I missing?
void MainComponent::getNextAudioBlock (const juce::AudioSourceChannelInfo& bufferToFill)
{
auto* device = deviceManager.getCurrentAudioDevice();
auto activeInputChannels = device->getActiveInputChannels();
auto activeOutputChannels = device->getActiveOutputChannels();
auto maxInputChannels = activeInputChannels .getHighestBit() + 1;
auto maxOutputChannels = activeOutputChannels.getHighestBit() + 1;
float *vpInOuts[maxOutputChannels];
for (auto channel = 0; channel < maxOutputChannels; ++channel)
{
if ((! activeOutputChannels[channel]) || maxInputChannels == 0)
{
bufferToFill.buffer->clear (channel, bufferToFill.startSample, bufferToFill.numSamples);
}
else
{
auto actualInputChannel = channel % maxInputChannels; // [1]
if (! activeInputChannels[channel]) // [2]
{
bufferToFill.buffer->clear (channel, bufferToFill.startSample, bufferToFill.numSamples);
}
else // [3]
{
const float* inBuffer = bufferToFill.buffer->getReadPointer (actualInputChannel,
bufferToFill.startSample);
float* outBuffer = bufferToFill.buffer->getWritePointer (channel, bufferToFill.startSample);
for (auto sample = 0; sample < bufferToFill.numSamples; ++sample)
{
// auto noise = (random.nextFloat() * 2.0f) - 1.0f;
outBuffer[sample] = inBuffer[sample]; // + (inBuffer[sample] * noise * level);
}
vpInOuts[channel] = outBuffer;
}
}
}
bufferToFill.buffer->setDataToReferTo(vpInOuts, maxOutputChannels, 0, bufferToFill.numSamples);
meterSource.measureBlock(*bufferToFill.buffer);
}
Thanks
Can you somehow verify that you have signal in the buffer?
Do you hear anything from the speakers at all?
Do you see the meter at all?
How many channels are reported?
Hello @daniel
I hadn’t enabled the microphone access in the projucer,
now everything is working fine, sorry for bothering.
Thanks
Lovely, glad you got it working

