Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (744)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (825)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Does any1 know any good LWJGL3 OpenAL library?  (Read 10796 times)
0 Members and 1 Guest are viewing this topic.
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Posted 2014-12-16 07:34:43 »

I usually use Paul's Code Sound System but recently I have found a few problems:
- doesn't work with LWJGL3
- I can't use inputstreams on it (I would like to use my own resource loader which returns an inputstream)
- When looking through the source (trying to fix the above problems) I started to see many silly ideas put into it

Then I thought about making my own... But I have no idea about OpenAL, loading .wav and .ogg files, etc.

So does anybody know any library for LWJGL3 OpenAL which can:
- load .wav and .ogg files from inputstream
- streaming sound or music files
- 3D surround sound with stuff like attenuation and doppler effect
- play, pause and stop sounds

Some stuff which I dont actually want but it would be nice:
- master volume
- Java Sound backing if OpenAL isn't supported
- the ability to make a sound play slower

Thx in advance...

Is it sad that I still get a fright when the computer beeps at me...
Offline basil_

« JGO Bitwise Duke »


Medals: 418
Exp: 13 years



« Reply #1 - Posted 2014-12-16 09:39:17 »

maybe it's a good moment to switch to fmod.

http://www.fmod.org/
http://jerome.jouvie.free.fr/nativefmod/index.php

not sure about the licence tho'.
Offline gouessej
« Reply #2 - Posted 2014-12-16 10:06:29 »

Hi

I use Paul Lamb Sound Library for years. Maybe you could modify your resource loader in order to return filenames or URLs instead of using this small limitation as a pretext to look for another library. Fmod isn't necessary and I don't like its license. Moreover, porting the plugin based on the second version of the library you use to the third one is quite easy to do and is (in my humble opinion) the most viable and easiest way of solving your problem. If you don't want to do it, contact Paul on his forum. I assume that he will do it. If I were you, I would contribute even with no knowledge of OpenAL as the "job" is clearly delimited, you wouldn't spend a lot of time on it and anyway it would be faster than switching to another library.

Edit.: Please avoid SMS language here. I find it particularly annoying to read. Keep in mind that some developers here aren't native speakers and it just drives things harder to understand.

Julien Gouesse | Personal blog | Website | Jogamp
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 119
Projects: 15


★★★★★


« Reply #3 - Posted 2014-12-16 10:58:35 »

I usually use Paul's Code Sound System but recently I have found a few problems:
- doesn't work with LWJGL3
If you like, you can use Paul's Code Sound System with LWJGL3. Ported it while working on a compatibility layer for LWJGL3. The LWJGL3 OpenAL library plug-in can be downloaded from here.
Offline gouessej
« Reply #4 - Posted 2014-12-16 12:03:18 »

Good job, the source code is inside the JAR.

Julien Gouesse | Personal blog | Website | Jogamp
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #5 - Posted 2014-12-16 12:57:38 »

I've actually decided to give OpenAL a go myself... Because the only thing that was worrying was loading the files... But Java Sound can load wave and au files, then I can just use J-ogg to load .ogg files...

But if I am unsuccessful, I will look at your suggestions... Thanks for the help anyway!
Btw, would you happen to know what this means?
1  
AL lib: (EE) UpdateDeviceParams: Failed to set 44100hz, got 48000hz instead


Thx in advance...

Is it sad that I still get a fright when the computer beeps at me...
Offline gouessej
« Reply #6 - Posted 2014-12-16 13:24:20 »

I'm sure that the very latest sound sample I added last night has a frequency of 44100hz. However, I don't use the same plugin (for OpenAL). If it uses OpenAL-Soft under the hood, it will work. I assume that the plugin uses OpenAL hardware and 44100hz isn't supported.

In my humble opinion, Java Sound is still too buggy to be useful.

Julien Gouesse | Personal blog | Website | Jogamp
Offline Nate

« JGO Bitwise Duke »


Medals: 167
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #7 - Posted 2014-12-16 19:08:25 »

Here's my OpenAL stuff for LWJGL 2, not sure what it would take to make it work with 3.
https://github.com/libgdx/libgdx/tree/master/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/audio

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 119
Projects: 15


★★★★★


« Reply #8 - Posted 2014-12-16 19:43:22 »

Here's my OpenAL stuff for LWJGL 2, not sure what it would take to make it work with 3.
https://github.com/libgdx/libgdx/tree/master/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/audio
I've been working on a LWJGL2 compatibility layer which runs on LWJGL3 (allows running LWJGL2 apps with very little source code changes). I did attempt to use it to port LibGDX to LWJGL3 (the audio part should work), however ran into a problem as LibGDX's LwjglApplication class seems to want to run LWJGL on a secondary thread which didn't sit well with GLFW. Ended up giving up after that point, did however get jMonkeyEngine3 working with it Smiley.
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #9 - Posted 2014-12-17 03:47:25 »

With that error, nothing bad happens it still runs... Maybe it has something to do with the sound engine which came with my headset? (Razer Kraken 7.1 if u r wondering)

Is it sad that I still get a fright when the computer beeps at me...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Waterwolf

Junior Devvie


Medals: 3



« Reply #10 - Posted 2015-05-29 13:52:37 »

If you like, you can use Paul's Code Sound System with LWJGL3. Ported it while working on a compatibility layer for LWJGL3. The LWJGL3 OpenAL library plug-in can be downloaded from here.

This library does not seem to work anymore as OpenAL binding has been changed even further? I tried to fix it by replacing instances of AL10.alListener with AL10.alListenerfv, but that seems to break the 3D sound.

Apparently AL10.alListener is not equal to AL10.alListenerfv, but I'm not sure how to fix it. Change them all to use AL10.alListener3f maybe?
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 119
Projects: 15


★★★★★


« Reply #11 - Posted 2015-05-29 14:24:47 »

This library does not seem to work anymore as OpenAL binding has been changed even further? I tried to fix it by replacing instances of AL10.alListener with AL10.alListenerfv, but that seems to break the 3D sound.
The code broke because of API's changes in LWJGL3 (it was in pre-alpha at the time), anyway I've updated the library to work with the latest nightly build of LWJGL3 and re-uploaded.

You can grab it from here.
Offline SHC
« Reply #12 - Posted 2015-05-29 17:07:43 »

I don't know very accurately, but 44100Hz is the quality of Audio CDs. It is 44800Hz for DVDs, that message essentially means you have better hardware that can play more quality audio than you requested. It is the frequency of the sound I think.

Offline Waterwolf

Junior Devvie


Medals: 3



« Reply #13 - Posted 2015-05-29 18:50:33 »

The code broke because of API's changes in LWJGL3 (it was in pre-alpha at the time), anyway I've updated the library to work with the latest nightly build of LWJGL3 and re-uploaded.

You can grab it from here.

Cheers! That's very useful.

Linear attenuation seems to work properly now, but I'm still having problems with rolloff attenuation. No matter how far or at what angle am I as the listener from the audio source, the volume stays constant.

 I think the problem is in the LWJGLOpenAL plugin, as disabling it and fallbacking to JavaSound makes it work properly.
Offline Spasi
« Reply #14 - Posted 2015-05-30 14:56:31 »

Btw, would you happen to know what this means?
1  
AL lib: (EE) UpdateDeviceParams: Failed to set 44100hz, got 48000hz instead

I don't know very accurately, but 44100Hz is the quality of Audio CDs. It is 44800Hz for DVDs, that message essentially means you have better hardware that can play more quality audio than you requested. It is the frequency of the sound I think.

I have pushed a change for this (build #50), the default ALContext creation will not try to override the device's ALC_FREQUENCY (or ALC_REFRESH). You shouldn't see this message anymore.
Pages: [1]
  ignore  |  Print  
 
 

 
Ecumene (143 views)
2017-09-30 02:57:34

theagentd (207 views)
2017-09-26 18:23:31

cybrmynd (291 views)
2017-08-02 12:28:51

cybrmynd (283 views)
2017-08-02 12:19:43

cybrmynd (293 views)
2017-08-02 12:18:09

Sralse (286 views)
2017-07-25 17:13:48

Archive (953 views)
2017-04-27 17:45:51

buddyBro (1089 views)
2017-04-05 03:38:00

CopyableCougar4 (1655 views)
2017-03-24 15:39:42

theagentd (1422 views)
2017-03-24 15:32:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!