我正在尝试使用 Minim FFT 库,但是在运行示例草图时,我遇到了以下问题:
The constructor FFT(int, float) is undefined.
我猜这个 Java 认为我正在尝试使用其他构造函数,但我终究无法弄清楚如何解决它。
这是代码的相关部分:
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];
}
最佳答案
尝试显式导入 FFT 类:
import ddf.minim.analysis.FFT;
我不确定为什么需要这样做,但我遇到了同样的问题并且它对我有用。
关于java - Processing.org/最小 FFT 误差,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15057653/