The VU counter only shows the short-term amplitude of the signal in a logarithmic scale (dB). You need to continuously measure the amplitude (RMS) of the signal for a short period of time (for example, 10 ms), and then convert the RMS value to dB and update the counter display.
RMS_signal (V) = sqrt(sum(x^2) / N)
N - (, N = 441 10 44,1 )
Magnitude (dB) = 20.0 * log10(RMS_signal) + K
K - ( ).
, . . fooobar.com/questions/641005/....