How to simulate analog VU meter response to audio?
if you have input signal as vector of floating point numbers, try following code. It won't behave as real VU meter, but by modifying two constants you should get something very similar. Visualize the value of C in logarithmical scale

// memory element (can be imagined as capacitor)
c = 0
kCharge = 0.1
kDischarge = 0.001

for each sample x:
{
  // rectify the signal
  x1 = abs(x)

  if x1 &gt; c then
  {
    // charge
    c = c * (1-kCharge) + x1*kCharge
  } else
  {
    // discharge
    c = c * (1-kDischarge)
  }
}