just some cleanup before recoding things...y
This commit is contained in:
parent
15a35f65dc
commit
2b1b8ba620
@ -9,7 +9,7 @@ import javax.sound.sampled.AudioInputStream;
|
|||||||
import javax.sound.sampled.AudioSystem;
|
import javax.sound.sampled.AudioSystem;
|
||||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||||
|
|
||||||
import org.tritonus.share.sampled.file.TAudioFileFormat;
|
import org.jaudiotagger.audio.AudioFile;
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.audio.Music;
|
import com.badlogic.gdx.audio.Music;
|
||||||
@ -30,7 +30,7 @@ public class Mp3Manager implements MusicManager {
|
|||||||
private AudioInputStream ais;
|
private AudioInputStream ais;
|
||||||
private AudioFormat af;
|
private AudioFormat af;
|
||||||
private AudioSampleReader d;
|
private AudioSampleReader d;
|
||||||
private Map<String, Object> properties;
|
|
||||||
public Mp3Manager(FileHandle file) {
|
public Mp3Manager(FileHandle file) {
|
||||||
this.fileHandle = file;
|
this.fileHandle = file;
|
||||||
|
|
||||||
@ -49,18 +49,6 @@ public class Mp3Manager implements MusicManager {
|
|||||||
} catch (IOException | UnsupportedAudioFileException e) {
|
} catch (IOException | UnsupportedAudioFileException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
// TAudioFileFormat properties
|
|
||||||
AudioFileFormat baseFileFormat = AudioSystem.getAudioFileFormat(file.file());
|
|
||||||
if (baseFileFormat instanceof TAudioFileFormat) {
|
|
||||||
properties = ((TAudioFileFormat)baseFileFormat).properties();
|
|
||||||
}
|
|
||||||
} catch (UnsupportedAudioFileException | IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
Gdx.app.debug("Property Count", String.valueOf(properties.size()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -112,7 +100,7 @@ public class Mp3Manager implements MusicManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getDuration() {
|
public float getDuration() {
|
||||||
return ((long) properties.get("duration"))/1000000f;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user