Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (494)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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  
  Directional Sounds - Using the cone angles...  (Read 4229 times)
0 Members and 1 Guest are viewing this topic.
Offline TubbyBtch

Junior Newbie





« Posted 2008-04-15 06:22:12 »

I was wanting to use directional sounds using JOAL.  Reading the OpenAL docs, it appears the commands to specify my cone angles are:

AL_CONE_INNER_ANGLE
AL_CONE_OUTER_ANGLE

Which don't seem to be implemented in JOAL.  I then plan to use the setConeOuterGain function to specify gain falloff when outside the cone.  Why would setConeOuterGain be implemented and not the cone angle settings (Considering that the default angle is 360 degrees).?

I don't see that the cone angle specification is in JOAL.  Is it implemented in another way? Am I missing something? 

Any help would be appreciated!

Tubby
Offline Ultraq

Junior Member




That's what she said


« Reply #1 - Posted 2008-04-15 07:46:28 »

By 'not implemented', do you mean that they throw some exception when you try to use them?  Or they just don't seem to have any effect?

Ultraq's Final MooCow
Bits and Pieces by Emanuel Rabina
Offline TubbyBtch

Junior Newbie





« Reply #2 - Posted 2008-04-20 21:59:33 »

It's probably me overlooking something, but I can't see where that setting is implemented.  I see a constant for these two...but how would I implement them for a particular source?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Ultraq

Junior Member




That's what she said


« Reply #3 - Posted 2008-04-21 06:53:39 »

The OpenAL programmers guide has:
AL_CONE_OUTER_GAIN       f, fv            the gain when outside the oriented cone
AL_CONE_INNER_ANGLE    f, fv, i, iv    the gain when inside the oriented cone
AL_CONE_OUTER_ANGLE   f, fv, i, iv    outer angle of the sound cone, in degrees default is 360

So you'd use alSource(f/fv/i/iv) for those, eg:

al.alSourcef(sourceid, AL_CONE_INNER_ANGLE, 1f);
al.alSourcef(sourceid, AL_CONE_OUTER_ANGLE, 30f);
al.alSourcef(sourceid, AL_CONE_OUTER_GAIN, 1f);

(the float values I'm passing are just examples, I don't even know if they're valid)

Ultraq's Final MooCow
Bits and Pieces by Emanuel Rabina
Offline TubbyBtch

Junior Newbie





« Reply #4 - Posted 2008-04-23 21:59:42 »

Appreciate the information....I'll try it!

Tubby
Offline TubbyBtch

Junior Newbie





« Reply #5 - Posted 2008-05-05 01:47:41 »

In my application, I created the source objects by instanciating the Source object.  Everything is working fine, but how do I get a integer source id (sid)?

I must be missing something...

Tubby
Offline Ultraq

Junior Member




That's what she said


« Reply #6 - Posted 2008-05-05 07:32:08 »

So you're using the sound3d package in JOAL?
Hmm you're right, I don't see a getSourceID() in there, or anything to give you the source ID of the Source.  That's quite annoying actually.

Maybe you could make your own Source object, one that'll give you access to the source ID.  Or, modify the source code of the existing JOAL sound3d package: source ID is a private final field in there, and it'd be a really quick change to add additional cone functions like you wanted, or to retrieve the source ID for other functions.

Ultraq's Final MooCow
Bits and Pieces by Emanuel Rabina
Offline TubbyBtch

Junior Newbie





« Reply #7 - Posted 2008-05-17 18:46:50 »

I will look into that.  Thanks for the response.  Maybe a nice feature for future upgrade?
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.

Dwinin (19 views)
2014-09-12 09:08:26

Norakomi (54 views)
2014-09-10 13:57:51

TehJavaDev (63 views)
2014-09-10 06:39:09

Tekkerue (31 views)
2014-09-09 02:24:56

mitcheeb (53 views)
2014-09-08 06:06:29

BurntPizza (37 views)
2014-09-07 01:13:42

Longarmx (23 views)
2014-09-07 01:12:14

Longarmx (27 views)
2014-09-07 01:11:22

Longarmx (26 views)
2014-09-07 01:10:19

mitcheeb (34 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!