Minim getGain() only returns value -64

edited April 2017 in Library Questions

I'm trying to get the decibel level from the microphone on my laptop. I'm using Minim but if there's another simpler way please let me know.

This code only returns the value -64. What am i doing wrong?

import ddf.minim.*;

Minim minim;
AudioInput in;

void setup()
{
  minim = new Minim(this);
  minim.debugOn();


  in = minim.getLineIn(Minim.STEREO, 512);
}

void draw()
{
 println(in.getGain());  
}

void stop()
{

  in.close();
  minim.stop();

  super.stop();
}
Sign In or Register to comment.