Question

I'm trying to use the Minim FFT library, but when running an example sketch, I run into the the following issue:

The constructor FFT(int, float) is undefined.

I am guessing that this Java thinks I am trying to use some other constructor, but I can't for the life of me figure out how to resolve it.

Heres the relevant part of the code:

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

FFT fft;
float[] buffer;
int bsize = 512;

void setup()
{
  size(512, 300, P3D);
  // create an FFT with a time-domain size the same as the size of buffer
  // it is required that these two values be the same
  // and also that the value is a power of two
  fft = new FFT(bsize, 44100);
  buffer = new float[bsize];
}
Was it helpful?

Solution

Try explicitly importing the FFT class:

import ddf.minim.analysis.FFT;

I'm not sure why this is required, but I was having the same problem and it worked for me.

OTHER TIPS

I had this issue with Processing 2. The issue in my case was that the Processing sketch was named "FFT". This created a naming issue. Your first solution could be to create a new sketch that's renamed to something else. Alternatively, you could try including the package path when you instantiate your FFT object. For example: "ddf.minim.analysis.FFT"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top