Attempts to load music with incorrect file names. #33

This commit is contained in:
fd 2015-03-07 19:45:56 -05:00
parent 8c24ef97c7
commit 64755bbc5c

View File

@ -149,6 +149,14 @@ public class OpenALStreamPlayer {
audio = new Mp3InputStream(ResourceLoader.getResourceAsStream(ref)); audio = new Mp3InputStream(ResourceLoader.getResourceAsStream(ref));
else else
audio = new OggInputStream(ResourceLoader.getResourceAsStream(ref)); audio = new OggInputStream(ResourceLoader.getResourceAsStream(ref));
if(audio.getRate() == 0 && audio.getChannels() == 0) {
if (ref.toLowerCase().endsWith(".mp3"))
audio = new OggInputStream(ResourceLoader.getResourceAsStream(ref));
else
audio = new Mp3InputStream(ResourceLoader.getResourceAsStream(ref));
}
} }
this.audio = audio; this.audio = audio;