public void createALC() { try { AL.create(); } catch (LWJGLException ex) { throw new RuntimeException(ex); } }
public OpenALManager(AudioConfig config) throws OpenALException, LWJGLException { logger.info("Initializing OpenAL audio manager"); config.subscribe(configListener); AL.create(); AL10.alGetError(); logger.info("OpenAL {} initialized!", AL10.alGetString(AL10.AL_VERSION)); ALCcontext context = ALC10.alcGetCurrentContext(); ALCdevice device = ALC10.alcGetContextsDevice(context); logger.info("Using OpenAL: {} by {}", AL10.alGetString(AL10.AL_RENDERER), AL10.alGetString(AL10.AL_VENDOR)); logger.info("Using device: {}", ALC10.alcGetString(device, ALC10.ALC_DEVICE_SPECIFIER)); logger.info("Available AL extensions: {}", AL10.alGetString(AL10.AL_EXTENSIONS)); logger.info("Available ALC extensions: {}", ALC10.alcGetString(device, ALC10.ALC_EXTENSIONS)); IntBuffer buffer = BufferUtils.createIntBuffer(1); ALC10.alcGetInteger(device, ALC11.ALC_MONO_SOURCES, buffer); logger.info("Max mono sources: {}", buffer.get(0)); buffer.rewind(); ALC10.alcGetInteger(device, ALC11.ALC_STEREO_SOURCES, buffer); logger.info("Max stereo sources: {}", buffer.get(0)); buffer.rewind(); ALC10.alcGetInteger(device, ALC10.ALC_FREQUENCY, buffer); logger.info("Mixer frequency: {}", buffer.get(0)); buffer.rewind(); AL10.alDistanceModel(AL10.AL_INVERSE_DISTANCE_CLAMPED); // Initialize sound pools pools.put("sfx", new OpenALSoundPool(30)); // effects pool pools.put("music", new OpenALStreamingSoundPool(2)); // music pool pools.get("sfx").setVolume(config.getSoundVolume()); pools.get("music").setVolume(config.getMusicVolume()); }
AL.create(); } catch (LWJGLException ex) { noDevice = true;
AL.create(); } catch (LWJGLException ex) { noDevice = true;
public void createALC() { try { AL.create(); } catch (LWJGLException ex) { throw new RuntimeException(ex); } }
@Override @Nullable public Object run() { try { AL.create(); soundWorks = true; sounds = true; music = true; log.fine("- Sound works"); } catch (Exception e) { log.warning("Sound initialisation failure." + e.getMessage()); soundWorks = false; sounds = false; music = false; } return null; } });
private static void initOpenAL() { // Initialize OpenAL if (!AL.isCreated()) { try { AL.create(); } catch (LWJGLException e) { log.error(e); } } }
public static void init() { if (!AL.isCreated()) { try { AL.create(); isExit = false; } catch (LWJGLException e) { log.error(e); } } }
/** * Initialise OpenAL LWJGL styley */ public void init() { try { AL.create(); soundWorks = true; } catch (LWJGLException e) { System.err.println("Failed to initialise LWJGL OpenAL"); soundWorks = false; return; } if (soundWorks) { IntBuffer sources = BufferUtils.createIntBuffer(1); AL10.alGenSources(sources); if (AL10.alGetError() != AL10.AL_NO_ERROR) { System.err.println("Failed to create sources"); soundWorks = false; } else { source = sources.get(0); } } }
public Object run() { try { AL.create(); soundWorks = true; sounds = true; music = true; Log.info("- Sound works"); } catch (Exception e) { Log.error("Sound initialisation failure."); Log.error(e); soundWorks = false; sounds = false; music = false; } return null; }});
AL.create("", 44100, 15, false); } catch (Exception e) { log.warning("Failed to initialize sound system.", e);
} else { try { AL.create("", 44100, 15, false); } catch (Exception e) { log.warning("Failed to initialize sound system.", e);
AL.create(); } catch (LWJGLException ex) { noDevice = true;
AL.create(); } catch (LWJGLException ex) { noDevice = true;