From 569af8adf972b776b5876ba91fa44bb4baf0f712 Mon Sep 17 00:00:00 2001 From: Recrown Date: Wed, 16 Aug 2017 23:13:10 -0500 Subject: [PATCH] Rhythm bullet mp3 support successful (prog calc a bit hacky) --- core/src/zero1hd/rhythmbullet/audio/Mp3AudioData.java | 2 +- core/src/zero1hd/rhythmbullet/entity/Entity.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/zero1hd/rhythmbullet/audio/Mp3AudioData.java b/core/src/zero1hd/rhythmbullet/audio/Mp3AudioData.java index 5e75862..89f5856 100755 --- a/core/src/zero1hd/rhythmbullet/audio/Mp3AudioData.java +++ b/core/src/zero1hd/rhythmbullet/audio/Mp3AudioData.java @@ -39,7 +39,7 @@ public class Mp3AudioData implements AudioData { public Mp3AudioData(FileHandle audioFile) { try { MP3File mp3File = new MP3File(audioFile.file()); - sampleCount = mp3File.getMP3AudioHeader().getNumberOfFrames(); + sampleCount = (long) (mp3File.getMP3AudioHeader().getPreciseTrackLength()*mp3File.getMP3AudioHeader().getSampleRateAsNumber()) + 2; //TODO figure out why this is correct since this way of calc was discovered by testing. durationInSeconds = mp3File.getMP3AudioHeader().getNumberOfFrames()/readWindowSize; sampleRate = mp3File.getMP3AudioHeader().getSampleRateAsNumber(); } catch (IOException | TagException | ReadOnlyFileException | InvalidAudioFrameException e) { diff --git a/core/src/zero1hd/rhythmbullet/entity/Entity.java b/core/src/zero1hd/rhythmbullet/entity/Entity.java index 96be070..2b6d83f 100755 --- a/core/src/zero1hd/rhythmbullet/entity/Entity.java +++ b/core/src/zero1hd/rhythmbullet/entity/Entity.java @@ -60,7 +60,6 @@ public class Entity extends Actor implements Poolable { } public void init(HashMap params) { - params.clear(); } /**