OAVp5.mic.rms#
variableoav-p5OAVp5.mic.rms
The raw loudness of the microphone: a smoothed RMS, 0 to 1, before oav-p5 turns it into the decibel scale of micLevel.
The root mean square of the samples in the latest frame, smoothed a little. It is linear, the way a waveform is drawn, so it suits a quick check or your own scale. micLevel is built from it: OAVp5.mic.db is the same number in dBFS, and OAVp5.mic.floor is the room's own noise, in dBFS too.
- Type
Number- Range
0..1
Updated once per display frame while the microphone is on; 0 when it is off. A speaking voice into a laptop is a small number, in the range 0.01 to 0.05 according to the comment in the code, which is why micLevel works in decibels.
Examples
function setup() {
createCanvas(400, 300);
startMic();
}
function draw() {
background(20);
fill(255);
text('rms ' + nf(OAVp5.mic.rms, 1, 4), 20, 30);
rect(20, 60, min(OAVp5.mic.rms * 10, 1) * (width - 40), 20); // magnified 10 times: a voice is small
}To be confirmed
Typical values for speech and music depend on the microphone and the room. The 0.01 to 0.05 for a voice is the code comment's figure and was not measured here.
Related
OAVp5.mic.dbThe loudness of the microphone in decibels relative to full scale (dBFS): 0 is as loud as it gets, −100 is silence or the microphone being off.OAVp5.mic.floorThe room's own noise as oav-p5 has measured it, in dBFS: the level thatmicLeveltreats as silence (plus 6 dB).OAVp5.mic.levelThe same 0 to 1 loudness asmicLevel, read without ever turning the microphone on.micLevelHow loud the microphone hears things, from 0 (a quiet room) to 1 (shouting).