简体   繁体   English

Processing.org/Minim FFT错误

[英]Processing.org/Minim FFT Error

I'm trying to use the Minim FFT library, but when running an example sketch, I run into the the following issue: 我正在尝试使用Minim FFT库,但在运行示例草图时,我遇到了以下问题:

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. 我猜这个Java认为我正在尝试使用其他一些构造函数,但我不能为我的生活弄清楚如何解决它。

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];
}

Try explicitly importing the FFT class: 尝试显式导入FFT类:

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. 我不确定为什么这是必需的,但我遇到了同样的问题而且对我有用。

I had this issue with Processing 2. The issue in my case was that the Processing sketch was named "FFT". 我在处理2时遇到了这个问题。我的问题是处理草图被命名为“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. 或者,您可以在实例化FFT对象时尝试包含程序包路径。 For example: "ddf.minim.analysis.FFT" 例如:“ddf.minim.analysis.FFT”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM