possible optimizations on wav reading
This commit is contained in:
@@ -22,8 +22,6 @@ public class WavAudioData implements AudioData {
|
||||
reset();
|
||||
try {
|
||||
decoder = new WavDecoder(file);
|
||||
decoder.initDataStream();
|
||||
decoder.getHeaderInfo();
|
||||
} catch (InvalidParameterException | IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
@@ -61,7 +59,13 @@ public class WavAudioData implements AudioData {
|
||||
|
||||
@Override
|
||||
public int readSamples(float[] samples) {
|
||||
return decoder.readSamples(samples);
|
||||
int samplesRead = 0;
|
||||
try {
|
||||
samplesRead = decoder.readSamples(samples);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return samplesRead;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -7,7 +7,6 @@ import com.badlogic.gdx.graphics.g2d.Sprite;
|
||||
import com.badlogic.gdx.utils.Pool.Poolable;
|
||||
|
||||
import zero1hd.rhythmbullet.entity.Entity;
|
||||
import zero1hd.rhythmbullet.entity.ally.PolyjetEntity;
|
||||
|
||||
public class Pellet extends Entity implements Poolable {
|
||||
|
||||
|
Reference in New Issue
Block a user