int bufferID = org.lwjgl.audio.vorbis.Util.CreateALBufferFromFile(path, 16);

Started by AGP, March 17, 2014, 07:28:14

Previous topic - Next topic

AGP

What is the current equivalent to that line? Thanks in advance.

quew8

Well I don't know if it's the exact equivalent but you can load a sound with the WaveData util class then that'll give you all the formatting options to give OpenAL.

In this example I'm just assuming you have an InputStream but there are all kinds of ways of getting a WaveData instance.
WaveData wd = WaveData.create(inputStream);
IntBuffer idBuff = BufferUtils.createIntBuffer(1);
AL10.alGenBuffers(idBuff);
int id = idBuff.get(0);
AL10.alBufferData(id, wd.format, wd.data, wd.samplerate);
wd.dispose();


Edit: Fixed error that AGP noticed.

AGP


AGP

The following line doesn't compile. I tried add, but that doesn't work, either:

buffers.put(bufferID, idBuff);

quew8

Yeah. Sorry. I essentially copied this from one of my utility classes must have forgot to get rid of that line. You can just delete it, doesn't do anything relevant here.

AGP

Cool, thanks. By the way, do you know the equivalent (or closest thing) of the old StreamPlaylist class?

quew8

I'm afraid I started with LWJGL way after all this stuff so I have no idea what that is.