I don't know if it's a problem with the computer I'm on or with Java or Ess or what. However, getSpectrum() is causing problems for me (or at least that's what the console tells me). It's confusing because it's not an error that happens every time I run the app.
Sometimes I run the app and my mp3 streams just fine. Other times, usually after closing the app window, making a minute change to the code and then relaunching it, it crashes and I get this error message:
Code:
java.lang.ArrayIndexOutOfBoundsException: 65536
at krister.Ess.FFTutils.getFrame(_FFTutils.java:32)
at krister.Ess.FFTutils.computeFFT(_FFTutils.java:114)
at krister.Ess.FFT.getSpectrum(FFT.java:84)
at Temporary_6899_9323.draw(Temporary_6899_9323.java:35)
at processing.core.PApplet.handleDisplay(PApplet.java:1336)
at processing.core.PGraphics.requestDisplay(PGraphics.java:535)
at processing.core.PApplet.run(PApplet.java:1152)
at java.lang.Thread.run(Unknown Source)
Here's my Ess setup stuff:
Code:
Ess.start(this);
daft = new AudioFile("hbfs.mp3", 0, Ess.READ, Ess.MIX);
out = new AudioStream(32*1024);
out.sampleRate(daft.sampleRate);
out.start();
analysis = new FFT(256);
equalize = false;
analysis.equalizer(equalize);
limit = false;
analysis.noLimits();
dampAmt = 1.0;
analysis.damp(dampAmt);
The statement: analysis.getSpectrum(out)
is what crashes the app.
Thoughts?