began work on making mp3spi work with libgdx
This commit is contained in:
@@ -74,18 +74,6 @@ public class Mp3AudioData implements AudioData {
|
||||
public void reset() {
|
||||
if (playbackMusic != null) {
|
||||
playbackMusic.stop();
|
||||
playbackMusic.dispose();
|
||||
playbackMusic = null;
|
||||
}
|
||||
|
||||
if (din != null) {
|
||||
try {
|
||||
din.close();
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,12 +136,16 @@ public class Mp3AudioData implements AudioData {
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
reset();
|
||||
playbackMusic.dispose();
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
if (din != null) {
|
||||
try {
|
||||
din.close();
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -76,6 +76,7 @@ public class WavAudioData implements AudioData {
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
reset();
|
||||
playbackMusic.dispose();
|
||||
decoder.cleanAndClose();
|
||||
}
|
||||
|
@@ -203,6 +203,9 @@ public class CreativeStage extends Stage implements MiniListener {
|
||||
beatViewer.setMusic(null, null);
|
||||
volumeWindow.setMusic(null);
|
||||
graphViewer.setData(null, null, null);
|
||||
if (musicPlayBackControls.getAudiofile() != null) {
|
||||
musicPlayBackControls.getAudiofile().dispose();
|
||||
}
|
||||
musicPlayBackControls.setAudiofile(null);
|
||||
analyzer = new AudioAnalyzer();
|
||||
analyzer.sender.addListener(this);
|
||||
|
Reference in New Issue
Block a user