code: 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);
  			}
  			
  		}
      }
docs: Initialise OpenAL LWJGL styley