public static int[] loadSource(String filepath, int maxSources, boolean looping) {
		// Load wav data into a buffer.
		//AL10.alGenBuffers(buffer);
		int buffer = AL10.alGenBuffers();

		int error = AL10.alGetError();
		if(error != AL10.AL_NO_ERROR) {
			System.err.println("Encountered AL error code " + error + "!");
			System.exit(-1);
		}

		//Loads the wave file from your file system
		java.io.FileInputStream fin = null;
		try {
			fin = new java.io.FileInputStream(filepath);
		} catch (java.io.FileNotFoundException e) {
			e.printStackTrace();
			System.exit(-1);
		}
		WaveData waveFile = WaveData.create(new BufferedInputStream(fin));
		try {
			fin.close();
		} catch (java.io.IOException ex) {}

		//Loads the wave file from this class's package in your classpath
		//WaveData waveFile = WaveData.create("FancyPants.wav");
		
		AL10.alBufferData(buffer, waveFile.format, waveFile.data, waveFile.samplerate);
		waveFile.dispose();

		int[] sources = new int[maxSources];
		
		for (int i = 0; i < maxSources; i++) {
		
		// Bind the buffer with the source.
		sources[i] = AL10.alGenSources();

		error = AL10.alGetError();
		if(error != AL10.AL_NO_ERROR) {
			System.err.println("Encountered AL error code " + error + "!");
			System.exit(-1);
		}

		AL10.alSourcei(sources[i], AL10.AL_BUFFER,   buffer   );
		AL10.alSourcef(sources[i], AL10.AL_PITCH,    1.0f     );
		AL10.alSourcef(sources[i], AL10.AL_GAIN,     1.0f     );
		AL10.alSource (sources[i], AL10.AL_POSITION, sourcePos);
		AL10.alSource (sources[i], AL10.AL_VELOCITY, sourceVel);
		if (looping)
			AL10.alSourcei(sources[i], AL10.AL_LOOPING,  AL10.AL_TRUE );

		}
		
		// Do another error check and return.
		error = AL10.alGetError();
		if(error != AL10.AL_NO_ERROR) {
			System.err.println("Encountered AL error code " + error + "!");
			System.exit(-1);
		}

		return sources;
	}