Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (552)
Games in Android Showcase (139)
games submitted by our members
Games in WIP (593)
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 4386 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:


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!

Offline Ultraq

Junior Devvie

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 Devvie

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!

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...

Offline Ultraq

Junior Devvie

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.

Archive (29 views)
2015-01-29 04:26:08

theagentd (25 views)
2015-01-28 15:33:52

GamerIDGoesHere (36 views)
2015-01-27 01:23:23

GamerIDGoesHere (37 views)
2015-01-27 01:22:15

CopyableCougar4 (47 views)
2015-01-27 00:34:41

CopyableCougar4 (30 views)
2015-01-26 04:47:56

Olo (23 views)
2015-01-25 21:26:00

Olo (28 views)
2015-01-25 18:44:22

Robo11 (46 views)
2015-01-25 06:14:26

basil_ (38 views)
2015-01-17 22:29:32
2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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 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‑
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!