open-audiovisual
Search GitHub

oav-p5 reference · Microphone and audio analysis

OAVp5.mic.sensitivity#

variableoav-p5
OAVp5.mic.sensitivity

Also: OAVp5.mic.gain

The microphone's sensitivity: 1 normally, 2 for twice as sensitive. micSensitivity() sets it; OAVp5.mic.gain is the old name.

The number multiplies what the microphone hears: on micLevel 2 adds 6 dB, on bass, mid and treble it multiplies by 2. Read it to show the current setting, and set it with micSensitivity(), which checks the number.

Type
Number
Range
0.05..20

Starts at 1. micSensitivity(v) keeps what you give it between 0.05 and 20.

Notes

  • OAVp5.mic.gain is the same value under the name oav-p5 0.3.0 used. Assigning to either works (OAVp5.mic.gain = 2) but is not held between 0.05 and 20, and gain falls back to 1 for a number that is not above 0.

Examples

jsOpenProcessing ↗
function setup() {
  createCanvas(400, 300);
  micSensitivity(3);   // a quiet or far-away microphone
}

function draw() {
  background(20);
  fill(255);
  text('sensitivity ' + OAVp5.mic.sensitivity, 20, 30);   // 3
  circle(width / 2, height / 2, 50 + micLevel * 300);
}
micSensitivity(3) sets the number, and OAVp5.mic.sensitivity reads it back. Asks for the microphone

Related

  • micSensitivity() Makes the microphone more or less sensitive: micSensitivity(2) is twice as sensitive, micSensitivity() says what it is now.
  • 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.

p5/oav-p5.js, line 897

↑ Back to top · All names