RMS stands for the Root Mean Square.
What is RMS
The Root Mean Square is a way to express the actual sound pressure of a piece of audio. It is a sort of averaging method that suits audio well.
Calculating and displaying RMS
- Select a 50 ms piece of audio (uncertain here, please confirm)
- Take each sample and multiply it by itself
- Take all those resulting values and add them
- Divide that by the amount of samples added (let's call that value "x")
- x = sqrtf(x);
- Silence is now 0.00, and the max (0 dB) point is 1.00 (but higher vales CAN occur in Buzz!)
- Scale this to the size of the graphics, leaving some space for the headroom (e.g. +6 dB)
If you want the RMS value scaled onto the x^3 curve as suggested by JoaCHIP's audio gui design page, simply replace step 5 with x = powf(x, 1/6).