progress on better system for audio managers
This commit is contained in:
parent
51ce146611
commit
fa93634b9e
@ -1,6 +1,5 @@
|
|||||||
package zero1hd.rhythmbullet.audio;
|
package zero1hd.rhythmbullet.audio;
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@ -103,7 +102,9 @@ public class Mp3Manager implements MusicManager {
|
|||||||
@Override
|
@Override
|
||||||
public void setReadIndexToPlaybackIndex() {
|
public void setReadIndexToPlaybackIndex() {
|
||||||
try {
|
try {
|
||||||
raf.seek((long) (getPositionInSeconds()*(long)sampleRate));
|
long pointer = (long) (getPositionInSeconds()*(long)sampleRate)-readWindowSize;
|
||||||
|
raf.seek(pointer);
|
||||||
|
readWindowIndex = (int) (pointer/readWindowSize);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,9 @@ public class WAVManager implements MusicManager {
|
|||||||
@Override
|
@Override
|
||||||
public void setReadIndexToPlaybackIndex() {
|
public void setReadIndexToPlaybackIndex() {
|
||||||
try {
|
try {
|
||||||
raf.seek((long) (getPositionInSeconds()*(long)getSampleRate()));
|
long pointer = (long) (getPositionInSeconds()*(long)getSampleRate())-readWindowSize;
|
||||||
|
raf.seek(pointer);
|
||||||
|
readWindowIndex = (int) (pointer/readWindowSize);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ public class VisualizerCore implements Disposable {
|
|||||||
this.width = width;
|
this.width = width;
|
||||||
this.xPos = x;
|
this.xPos = x;
|
||||||
this.yPos = y;
|
this.yPos = y;
|
||||||
updateRate = 1f/30f;
|
updateRate = 1f/60f;
|
||||||
lock = new ReentrantLock();
|
lock = new ReentrantLock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user