@Override
	public void load(Core core) throws ResourceException {
		IntBuffer buffer = BufferUtils.createIntBuffer(1);
		AL10.alGenBuffers(buffer);
		int error = AL10.alGetError();
		if (error != AL10.AL_NO_ERROR) {
			throw new ResourceException("unable to create buffer, error: " + error);
		}		
		
		InputStream is = ResourceService.getInstance(core).getStream(this.filename);
		if (is == null) {
			throw new ResourceException("resource not found " + this.filename);
		}
		
		WaveData waveFile = WaveData.create(is);
		AL10.alBufferData(buffer.get(0), waveFile.format, waveFile.data, waveFile.samplerate);
		error = AL10.alGetError();
		if (error != AL10.AL_NO_ERROR) {
			throw new ResourceException("unable to load sound buffer, error: " + error);
		}		
		waveFile.dispose();
		
		this.sound = new Sound(buffer.get(0));
	}