open-audiovisual
Search GitHub

oav-p5 reference · Microphone and audio analysis

micSensitivity()#

functionoav-p5
micSensitivity([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

NameTypeDescription
vNumberThe 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.gain is the same knob under the name oav-p5 0.3.0 used.

Examples

jsOpenProcessing ↗
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
}
The same loudness circle on a microphone that needed a boost; the number shows the sensitivity in effect. Asks for the microphone

Related

  • micLevel How loud the microphone hears things, from 0 (a quiet room) to 1 (shouting).
  • bass How 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.

p5/oav-p5.js, line 1075

↑ Back to top · All names