diff --git a/core/src/zero1hd/rhythmbullet/audio/Mp3Manager.java b/core/src/zero1hd/rhythmbullet/audio/Mp3Manager.java index 630c96d..aa300f1 100755 --- a/core/src/zero1hd/rhythmbullet/audio/Mp3Manager.java +++ b/core/src/zero1hd/rhythmbullet/audio/Mp3Manager.java @@ -1,6 +1,5 @@ package zero1hd.rhythmbullet.audio; -import java.io.BufferedInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; @@ -103,7 +102,9 @@ public class Mp3Manager implements MusicManager { @Override public void setReadIndexToPlaybackIndex() { try { - raf.seek((long) (getPositionInSeconds()*(long)sampleRate)); + long pointer = (long) (getPositionInSeconds()*(long)sampleRate)-readWindowSize; + raf.seek(pointer); + readWindowIndex = (int) (pointer/readWindowSize); } catch (IOException e) { e.printStackTrace(); } diff --git a/core/src/zero1hd/rhythmbullet/audio/WAVManager.java b/core/src/zero1hd/rhythmbullet/audio/WAVManager.java index e10d211..089f625 100755 --- a/core/src/zero1hd/rhythmbullet/audio/WAVManager.java +++ b/core/src/zero1hd/rhythmbullet/audio/WAVManager.java @@ -58,7 +58,9 @@ public class WAVManager implements MusicManager { @Override public void setReadIndexToPlaybackIndex() { try { - raf.seek((long) (getPositionInSeconds()*(long)getSampleRate())); + long pointer = (long) (getPositionInSeconds()*(long)getSampleRate())-readWindowSize; + raf.seek(pointer); + readWindowIndex = (int) (pointer/readWindowSize); } catch (IOException e) { e.printStackTrace(); } diff --git a/core/src/zero1hd/rhythmbullet/audio/visualizer/VisualizerCore.java b/core/src/zero1hd/rhythmbullet/audio/visualizer/VisualizerCore.java index 55bb058..4c412ce 100755 --- a/core/src/zero1hd/rhythmbullet/audio/visualizer/VisualizerCore.java +++ b/core/src/zero1hd/rhythmbullet/audio/visualizer/VisualizerCore.java @@ -24,7 +24,7 @@ public class VisualizerCore implements Disposable { this.width = width; this.xPos = x; this.yPos = y; - updateRate = 1f/30f; + updateRate = 1f/60f; lock = new ReentrantLock(); }