improvements on visualizer in terms of synchronization
This commit is contained in:
@@ -38,7 +38,7 @@ public class BasicVisualizer extends VisualizerCore {
|
||||
pixmap.setColor(Color.WHITE);
|
||||
pixmap.fill();
|
||||
barCount = 70;
|
||||
smoothRange = 2;
|
||||
smoothRange = 3;
|
||||
angleRot = new Vector2(MathUtils.cosDeg(rotation), MathUtils.sinDeg(rotation));
|
||||
bars = new Sprite[barCount];
|
||||
barHeights = new float[barCount];
|
||||
@@ -106,7 +106,7 @@ public class BasicVisualizer extends VisualizerCore {
|
||||
public void setMM(MusicManager mm) {
|
||||
maxAvgHeight = 0;
|
||||
currentAvg = 0;
|
||||
float validBins = (5500/((mm.getSampleRate()/2)/((mm.getReadWindowSize()/2)+1)));
|
||||
float validBins = (6400/((mm.getSampleRate()/2)/((mm.getReadWindowSize()/2)+1)));
|
||||
Gdx.app.debug("Visualizer", "valid frequency bins " + validBins);
|
||||
binsPerBar = MathUtils.round((validBins/barCount));
|
||||
barHeights = new float[barCount];
|
||||
|
@@ -10,8 +10,9 @@ public interface MusicManager extends Disposable {
|
||||
/**
|
||||
* sets a integer variable to the current window of audio data the playback is at.
|
||||
* Useful for efficiency because we compute once for that frame then get the values everytime it is required instead of calculating every time we get the index.
|
||||
* @return the playback window index.
|
||||
*/
|
||||
public void playbackIndexUpdate();
|
||||
public int playbackIndexUpdate();
|
||||
|
||||
/**
|
||||
* Gets the current position in seconds
|
||||
|
Reference in New Issue
Block a user