compatibility fix

When the system is not capable to play the sound, do not throw
exception, just log it. For example on Linux there are several issues to
play sound and there are no workarounds for that :(
This commit is contained in:
Mihály Kuprivecz 2017-05-11 21:41:25 +02:00
parent ee3744cb0a
commit 857902ab95

View File

@ -132,16 +132,18 @@ public class Audio {
}
Clip clip = null;
try {
headIndex++;
clip = AudioSystem.getClip();
clip.open(getPendingAudio()[headIndex].stream);
clip.start();
headIndex++;
} catch (LineUnavailableException e) {
System.err.println("Error occoured while loading the audio: The line is unavailable");
e.printStackTrace();
} catch (IOException e) {
System.err.println("Input/Output error while loading the audio");
e.printStackTrace();
} catch (IllegalArgumentException e) {
System.err.println("The system doesn't support the sound: " + e.getMessage());
}
}