Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
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  
  paulscode 3D sound issues  (Read 860 times)
0 Members and 1 Guest are viewing this topic.
Offline Quarry
« Posted 2013-08-20 08:59:52 »

1  
2  
3  
4  
5  
6  
   public static void playAt(String sound, float x, float y, float z) {
      ss.setListenerPosition(Game.player.pos.x, Game.player.pos.y, Game.player.pos.z);
      ss.setListenerVelocity(Game.player.dVel.x, 0, Game.player.dVel.y);
      ss.setListenerAngle(Game.player.yaw);
      ss.quickPlay(false, sound, false, x, y, z, SoundSystemConfig.ATTENUATION_ROLLOFF, 0.03f);
   }


My issue is that above code even though I tried every possible value for the rolloff between 0 and 1 (suggested by the PDF paul provided) won't have any change on the sound's volume
Offline Quarry
« Reply #1 - Posted 2013-08-20 12:45:19 »

Bump, I need help on this urgently
Offline gouessej
« Reply #2 - Posted 2013-08-20 13:12:28 »

Hi

Please keep in mind that we are volunteers.

Which backend do you use? JavaSound? JOAL? Have you looked at the source code? Maybe the roll off factor is not taken into account in some cases.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline nsigma
« Reply #3 - Posted 2013-08-20 13:35:42 »

Which backend do you use? JavaSound? JOAL? Have you looked at the source code? Maybe the roll off factor is not taken into account in some cases.

Also, what OS?

I highly suspect you're using the JavaSound backend with a JavaSound implementation that doesn't support volume control - it's a key flaw in this library that it lacks a built in software mixer.

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline Quarry
« Reply #4 - Posted 2013-08-20 13:38:56 »

I'm using LWLJGL OpenAL

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
Checking if LWJGL OpenAL is compatible...
    ...yes

Checking if Java Sound is compatible...
    ...no

Starting up SoundSystem...
Initializing LWJGL OpenAL
    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
OpenAL initialized.
Offline nsigma
« Reply #5 - Posted 2013-08-20 13:42:43 »

Ah well, suspicions incorrect!  Emo

Over to someone who knows more about OpenAL and this lib then.  Grin

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline gouessej
« Reply #6 - Posted 2013-08-20 13:54:00 »

it lacks a built in software mixer.
JOAL and its competitor use OpenAL-Soft.

Quarry, have you looked at the source code a bit to know whether this setting is not ignored?

Offline nsigma
« Reply #7 - Posted 2013-08-20 14:38:40 »


I meant that the JavaSound backend is missing a software mixer.

I wish you'd stop using that "competitor" word - it's just going to be confusing to anyone who doesn't know you!  Wink

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline Quarry
« Reply #8 - Posted 2013-08-20 14:44:54 »

I checked the source code and couldn't find anything out of place, this is really bothering me!

Here's my Sounder class, I'm not sure if anything is out of place...

http://pastebin.com/LN7fEnnq
Online Phased
« Reply #9 - Posted 2013-08-20 14:45:46 »

For the small chance, your passing a global volume sound in, and its not specific to that sound file.

1  
soundSystem.setMasterVolume(1.0f);


Also, if you decide to reload the sounds into the sound system, you can specify the sound and specify the volume of a particular sound file.

1  
soundSystem.setVolume(sourceName, volume);


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Quarry
« Reply #10 - Posted 2013-08-20 14:52:15 »

So, I recalled that Minecraft also uses the same library. So I went on to my decompiled copy and found out that it uses ATTENUATION_LINEAR

It works now

Fix your code paul
Offline nsigma
« Reply #11 - Posted 2013-08-20 15:04:50 »

Fix your code paul

Ah, writers of free code love that sort of attitude!  Roll Eyes  How about reporting a bug or asking him about it?

Incidentally, are you using a stereo sound file?  The JavaDoc does say this only works with mono sounds in OpenAL.  May not be a bug at all!

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline Quarry
« Reply #12 - Posted 2013-08-20 15:23:29 »

All my sounds are mono
Offline gouessej
« Reply #13 - Posted 2013-08-26 12:28:40 »

I wish you'd stop using that "competitor" word - it's just going to be confusing to anyone who doesn't know you!  Wink
There are 2 sets of Java bindings (JogAmp, ...) for several native APIs (OpenGL, OpenAL, OpenCL). Their respective teams are in competition even though I don't like this situation. Therefore, the term "competitor" seems to be the right one.

Offline nsigma
« Reply #14 - Posted 2013-08-26 14:49:55 »

I wish you'd stop using that "competitor" word - it's just going to be confusing to anyone who doesn't know you!  Wink
There are 2 sets of Java bindings (JogAmp, ...) for several native APIs (OpenGL, OpenAL, OpenCL). Their respective teams are in competition even though I don't like this situation. Therefore, the term "competitor" seems to be the right one.

I kind of meant just name the damn thing.  Grin  It's called LWJGL - there, not so hard!  It's OK for projects to refer to each other.  To not do so makes you sound about 5!  Tongue

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (26 views)
2014-07-24 01:59:36

Riven (25 views)
2014-07-23 21:16:32

Riven (19 views)
2014-07-23 21:07:15

Riven (22 views)
2014-07-23 20:56:16

ctomni231 (51 views)
2014-07-18 06:55:21

Zero Volt (46 views)
2014-07-17 23:47:54

danieldean (37 views)
2014-07-17 23:41:23

MustardPeter (40 views)
2014-07-16 23:30:00

Cero (56 views)
2014-07-16 00:42:17

Riven (55 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!