OAVp5.mic.level#
variableoav-p5OAVp5.mic.level
The same 0 to 1 loudness as micLevel, read without ever turning the microphone on.
micLevel is a getter that returns this number and, the first time it is read, asks for the microphone. OAVp5.mic.level is the number itself, so reading it is safe anywhere: before the user has chosen, with ?oav_mic=click, or in a library. Start the microphone with startMic() or 🎤, then it moves. How it is measured (decibels, the room as zero, −10 dBFS as 1) is described under micLevel.
- Type
Number- Range
0..1
Updated once per display frame while the microphone is on; 0 while it is off, asking, blocked or missing.
Examples
function setup() {
createCanvas(400, 300);
startMic();
}
function draw() {
background(20);
circle(width / 2, height / 2, 50 + OAVp5.mic.level * 300);
}Related
micLevelHow loud the microphone hears things, from 0 (a quiet room) to 1 (shouting).OAVp5.mic.rmsThe raw loudness of the microphone: a smoothed RMS, 0 to 1, before oav-p5 turns it into the decibel scale ofmicLevel.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).startMic()Turns the microphone on and returns a promise that says whether it worked.