mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
don't just give up when LinePool can't be initialized
maybe fixes #2525
This commit is contained in:
parent
b5bb6dd0db
commit
5d55d299a2
1 changed files with 12 additions and 2 deletions
|
@ -50,7 +50,15 @@ public class AudioManager {
|
|||
* AudioManager singleton.
|
||||
*/
|
||||
private static final AudioManager audioManager = new AudioManager();
|
||||
private final LinePool linePool = new LinePool();
|
||||
private LinePool linePool;
|
||||
|
||||
public AudioManager() {
|
||||
try {
|
||||
linePool = new LinePool();
|
||||
} catch (Exception e) {
|
||||
log.warn("Failed to initialize AudioManager. No sounds will be played.", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static AudioManager getManager() {
|
||||
return audioManager;
|
||||
|
@ -297,7 +305,9 @@ public class AudioManager {
|
|||
}
|
||||
|
||||
public void play(final MageClip mageClip) {
|
||||
linePool.playSound(mageClip);
|
||||
if (linePool != null) {
|
||||
linePool.playSound(mageClip);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue