another attempt to better remedy song transition for visualizer
This commit is contained in:
parent
8cbefb1f0f
commit
67f9105922
@ -39,15 +39,15 @@ public class VisualizerCore implements Disposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setMM(MusicManager mm) {
|
public void setMM(MusicManager mm) {
|
||||||
|
lock.lock();
|
||||||
if (audioPCM == null || audioPCM.length != mm.getReadWindowSize()) {
|
if (audioPCM == null || audioPCM.length != mm.getReadWindowSize()) {
|
||||||
calc = false;
|
calc = false;
|
||||||
lock.lock();
|
|
||||||
fft = new FloatFFT_1D(mm.getReadWindowSize());
|
fft = new FloatFFT_1D(mm.getReadWindowSize());
|
||||||
audioPCM = new float[mm.getReadWindowSize()];
|
audioPCM = new float[mm.getReadWindowSize()];
|
||||||
lock.unlock();
|
|
||||||
}
|
}
|
||||||
this.mm = mm;
|
this.mm = mm;
|
||||||
calc = true;
|
calc = true;
|
||||||
|
lock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(Batch batch, float parentAlpha) {
|
public void render(Batch batch, float parentAlpha) {
|
||||||
|
Loading…
Reference in New Issue
Block a user