micSensitivity()#
functionoav-p5micSensitivity([v])
Makes the microphone more or less sensitive: micSensitivity(2) is twice as sensitive, micSensitivity() says what it is now.
The number multiplies what the microphone hears. On micLevel, 2 adds 6 dB; on bass, mid and treble it multiplies by 2 (they stay held to 1). Use it for a quiet microphone or a far-away voice: micSensitivity(3) in setup() adds about 9.5 dB.
Parameters
| Name | Type | Description |
|---|---|---|
v | Number | The new sensitivity, greater than 0 (kept between 0.05 and 20). Leave it out, or pass something that is not greater than 0, to change nothing. optional |
Returns
Number The sensitivity now in effect (1 until you change it).
Notes
OAVp5.mic.gainis the same knob under the name oav-p5 0.3.0 used.
Examples
function setup() {
createCanvas(400, 300);
micSensitivity(3); // three times as sensitive
}
function draw() {
background(20);
circle(width / 2, height / 2, 50 + micLevel * 300);
text('sensitivity ' + micSensitivity(), 20, 30); // no argument: just reads it
}Related
micLevelHow loud the microphone hears things, from 0 (a quiet room) to 1 (shouting).bassHow much of the microphone's sound is low (bass), middle (mid) or high (treble), each from 0 to 1.startMic()Turns the microphone on and returns a promise that says whether it worked.