Help with AudioInput

edited May 2014 in Library Questions

Hello, I'm trying to get the volume level from my mic to adjust the size of a box. But I have the following issues: a) getGain seems to be giving me -64 constantly b) getVolume doesnt seem to be available

I did get a sample file to respond to the mic rather than the audio file

Here is what I have

import ddf.minim.analysis.*;
import ddf.minim.*;

Minim       minim;
AudioInput  accessMic;
FFT         fft;
float boxSize;

void setup () {
  size(512, 200, P3D);
  minim = new Minim(this);
  accessMic = minim.getLineIn();
  rectMode(CENTER);

}

void draw() {
  background(255);
  boxSize = accessMic.getGain();
  stroke(255);
  println(boxSize);
  fill(0);
  rect(width/2,height/2,boxSize,boxSize);
}

Thank you in advance!

Tagged:

Answers

Sign In or Register to comment.