1 Reply

You can get the audio level in dB or in RMS (root mean square) using the script below, then change the Y scale based on the value returned. RMS values are easier to use, since they range from 0 to 1. dB values are more complicated, because they are calculated by 20*Log10(rmsValue/refValue): thus, the value returned may be positive (sound > ref level) or negative (sound < ref level). Negative dB values are clamped to -160, but positive values have no limit. There's a more complete version of this script in this answer - the dominant pitch of the sound is returned too.

The object to which the script below is attached must also have the audio source, and will vary its vertical scale according to the RMS value: