import ddf.minim.*;
import ddf.minim.analysis.*;
Minim minim;
AudioPlayer audio;
final int BUFFERSIZE = 2048;
void setup()
{
minim = new Minim(this);
audio = minim.loadFile("audio.mp3");//, BUFFERSIZE);
audio.play();
size(800, 800);
stroke(0);
}
void draw()
{
println(audio.left.get(1)); // Sometimes I get negative value
background(255);
ellipse(200, 400, audio.left.get(1)*800, audio.left.get(1)*800);
ellipse(600, 400, audio.right.get(1)*800, audio.right.get(1)*800);
//audio.drawShape();
}
How is it possible for me to get a negative value? Shouldn’t it only be positive value?