minor tuning to visualizer

This commit is contained in:
Harrison Deng 2018-01-30 12:49:03 -06:00
parent 5e3188ccc8
commit c70d161337
3 changed files with 2 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 121 KiB

View File

@ -69,7 +69,7 @@ public class BasicVisualizer extends VisualizerCore {
for (int i = 0; i < barCount; i++) {
float barHeight = 0;
for (int j = 0; j < binsPerBar; j++) {
barHeight += Math.abs(audioPCM[j+i*binsPerBar]);
barHeight += Math.abs(audioPCM[j+i*binsPerBar +1]);
}
barHeight /= binsPerBar;
barHeight *= barHeightMultiplier;
@ -106,7 +106,7 @@ public class BasicVisualizer extends VisualizerCore {
public void setMM(MusicManager mm) {
maxAvgHeight = 0;
currentAvg = 0;
float validBins = (9000/((mm.getSampleRate()/2)/((mm.getReadWindowSize()/2)+1)));
float validBins = (5000/((mm.getSampleRate()/2)/((mm.getReadWindowSize()/2)+1)));
Gdx.app.debug("Visualizer", "valid frequency bins " + validBins);
binsPerBar = MathUtils.round((validBins/barCount));
barHeights = new float[barCount];

View File

@ -89,7 +89,6 @@ public class VisualizerCore implements Disposable {
public MusicManager getMm() {
return mm;
}
public float[] getAudioPCM() {
return audioPCM;
}