possible optimizations on wav reading

This commit is contained in:
2017-08-12 01:29:56 -05:00
parent d32794152d
commit a47cd1993b
3 changed files with 30 additions and 104 deletions

View File

@@ -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

View File

@@ -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 {