Skip to content

Commit 26e6146

Browse files
tristanbaykevinstadler
authored andcommitted
Correct reference to wrong input array length
Leads to an assertion error when the input audio length is not also a power of 2
1 parent 23108c9 commit 26e6146

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/processing/sound/FFT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public static float[] analyzeSample(float[] sample, int numBands) {
136136
// the meat of the matter
137137
protected static void calculateMagnitudesFromSample(float[] sample, float[] imaginary, float[] target) {
138138
if (FFT.checkNumBands(target.length)) {
139-
FourierMath.transform(1, sample.length, sample, imaginary);
139+
FourierMath.transform(1, target.length, sample, imaginary);
140140
FourierMath.calculateMagnitudes(sample, imaginary, target);
141141
// there is an argument for multiplying the normalized spectrum amplitude
142142
// values by two, see e.g.:

0 commit comments

Comments
 (0)