What range does getAvg() return in Minim?

edited January 2017 in Library Questions

I am trying to create a music visualizer using the FFT in Minim. For my calculations, I need getAvg() to return a number between 0 and 1, which I can then convert to dBA. However, it seems to give me numbers between 0 and some other number like 27 when I play a file with full amplitude noise created in Audacity. So what is getAvg() actually returning and how can I get it to be between 0 and 1?

I have this in my setup function:

fft = new FFT(song.bufferSize(), song.sampleRate());
fft.logAverages(22, bandsPerOctave);

and this in my draw function:

fft.forward(song.mix);
for(int i = 0; i < fft.avgSize(); i++)
{
  float amplitude = fft.getAvg(i);
  println(amplitude);
}

Answers

Sign In or Register to comment.