Gin
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
RMSMeter Class Reference

Sliding window RMS meter, one reading per channel. More...

#include <gin_rmsmeter.h>

Public Member Functions

 RMSMeter ()=default
 
void prepare (double sampleRate, int numChannels, double windowSeconds=0.3)
 Not realtime safe.
 
void reset ()
 Clears the window.
 
void process (const juce::AudioBuffer< float > &buffer)
 
float getRMS (int channel) const
 RMS of the window, dBFS.
 
float getRMSLinear (int channel) const
 RMS of the window, linear.
 
int getNumChannels () const
 
double getWindowSeconds () const
 

Static Public Attributes

static constexpr float silence = -100.0f
 

Detailed Description

Sliding window RMS meter, one reading per channel.

The window length is fixed at prepare() time. Readings are plain RMS, so a full scale sine reads -3.01 dBFS; add 3.01 dB for an AES-17 style scale where a full scale sine reads 0.

Call process() from the audio thread; the getters are safe from any thread.

Constructor & Destructor Documentation

◆ RMSMeter()

RMSMeter::RMSMeter ( )
default

Member Function Documentation

◆ prepare()

void RMSMeter::prepare ( double  sampleRate,
int  numChannels,
double  windowSeconds = 0.3 
)

Not realtime safe.

◆ reset()

void RMSMeter::reset ( )

Clears the window.

Safe from any thread.

◆ process()

void RMSMeter::process ( const juce::AudioBuffer< float > &  buffer)

◆ getRMS()

float RMSMeter::getRMS ( int  channel) const

RMS of the window, dBFS.

◆ getRMSLinear()

float RMSMeter::getRMSLinear ( int  channel) const

RMS of the window, linear.

◆ getNumChannels()

int RMSMeter::getNumChannels ( ) const

◆ getWindowSeconds()

double RMSMeter::getWindowSeconds ( ) const

Member Data Documentation

◆ silence

constexpr float RMSMeter::silence = -100.0f
staticconstexpr

The documentation for this class was generated from the following file: