Tone.Meter
↳ EXTENDS ToneTone.Meter gets the RMS of an input signal with some averaging applied. It can also get the raw value of the signal or the value in dB. For signal processing, it’s better to use Tone.Follower which will produce an audio-rate envelope follower instead of needing to poll the Meter to get the output.
Meter was inspired by Chris Wilsons Volume Meter.
CONSTRUCTOR
new Tone.Meter ( [channels
= 1 ] , [ smoothing
= 0.8 ] , [ clipMemory
= 0.5 ]
)
channels
number of channels being metered
type:
number
default:
1
smoothing
amount of smoothing applied to the volume
type:
number
default:
0.8
clipMemory
number in seconds that a “clip” should be remembered
type:
number
default:
0.5
DEFAULTS
{
smoothing
:
0.8
,
bufferSize
:
1024
,
clipMemory
:
0.5
,
clipLevel
:
0.9
,
channels
:
1
}
EXAMPLE
var meter = new Tone.Meter();
var mic = new Tone.Microphone().start();
//connect mic to the meter
mic.connect(meter);
//use getLevel or getDb
//to access meter level
meter.getLevel();Members
.smoothing
↝ NormalRange #The amount which the decays of the meter are smoothed. Small values will follow the contours of the incoming envelope more closely than large values.
Methods
.getDb ( )
#Get the volume of the signal in dB
.getLevel ( )
#Get the rms of the signal.