Hello Guest

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

  • 6 Replies
  • 5440 Views
*

Offline AGP

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

*

Offline quew8

  • *****
  • 569
  • Because Square Eyes Look More Real
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.
Code: [Select]
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.
« Last Edit: March 26, 2014, 23:40:58 by quew8 »

*

Offline AGP

  • **
  • 51
Thanks very much. I'll try it out and report back.

*

Offline AGP

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

Code: [Select]
buffers.put(bufferID, idBuff);

*

Offline quew8

  • *****
  • 569
  • Because Square Eyes Look More Real
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.

*

Offline AGP

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

*

Offline quew8

  • *****
  • 569
  • Because Square Eyes Look More Real
I'm afraid I started with LWJGL way after all this stuff so I have no idea what that is.