Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
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  
  sound3d package status  (Read 2425 times)
0 Members and 1 Guest are viewing this topic.
Offline bigor

Senior Newbie





« Posted 2006-01-29 15:52:02 »

Hi,
I downloaded latest joal release so I found that it has sound3d package. I love its architecture, it is much more object oriented and "java style", so I hoped I could use it in my game. But, it just doesn't work.
this is the code:

try
        {
            AudioSystem3D.init();
            AudioSystem3D.generateBuffers(1);
            AudioSystem3D.generateSources(1);
            Buffer buff = AudioSystem3D.loadBuffer("data/audio/Explode.wav");
            Source source = AudioSystem3D.generateSource(buff);
            source.setPosition(0, 0, 0);
            AudioSystem3D.getListener().setPosition(0, 0, 0);
            source.setMaxDistance(100);
            source.play();
        }
        catch (Exception e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }


it doesnt rise exception, it just doesnt play anything.  file is defenetly there and it works good with lwjgl's joal wrapper.

One another thing bothers me. In joal windows binaries there is joal.jar and joal.dll, but without OpenAL.dll (from lwjgl libraries) it rises exception: net.java.games.joal.OpenALException: Could not load openal library.

So my questions are:

1. what is the status of net.java.games.sound3d package
2. what's wrong with my code above
3. which dll's I need to use joal
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #1 - Posted 2006-01-30 04:26:57 »

The Sound3D toolkit isn't really under active development. However, we can certainly make changes if you have suggestions.

The following slightly modified version of your test case works. Note the creation of the Device and Context which were missing. Additionally the program was exiting before the sound had finished playing. This shouldn't be a problem in a normal game.

Please try downloading the new JOAL binaries which are now linked to from the JOAL home page. The API has changed somewhat from the older releases, but the new version should be stable and the implementation should also be more robust than the older one.

Java Web Start binaries, etc. still to come.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
import net.java.games.joal.*;
import net.java.games.sound3d.*;

public class ASTest {
  public static void main(String[] args) {
    try
      {
        AudioSystem3D.init();
        Device dev = AudioSystem3D.openDevice(null);
        Context ctx = AudioSystem3D.createContext(dev);
        AudioSystem3D.makeContextCurrent(ctx);
        AudioSystem3D.generateBuffers(1);
        AudioSystem3D.generateSources(1);
        Buffer buff = AudioSystem3D.loadBuffer("FancyPants.wav");
        Source source = AudioSystem3D.generateSource(buff);
        source.setPosition(0, 0, 0);
        AudioSystem3D.getListener().setPosition(0, 0, 0);
        source.setMaxDistance(100);
        source.play();
        Thread.sleep(5000);
      }
    catch (Exception e)
      {
        // TODO Auto-generated catch block
       e.printStackTrace();
      }
  }
}

Offline bigor

Senior Newbie





« Reply #2 - Posted 2006-01-30 16:43:06 »

Hi, Ken, thanx for your help.

I made my code work in another way. i just added ALut.alutInit() after  AudioSystem3D.init(); and it works  now. Which way is right way, my or yours?

My code was actually inside of class constructor and that class extends JFrame, so my program wasn't really exiting untill I close the window.

I foud sound3d package very helpfull and much cleaner designed for use in java apps.

as java programer I  prefer calling methods like   AudioSystem3D.getListener().setPosition(0, 0, 0);  then AL10.alListener(AL10.AL_POSITION, listenerPosition);

I think that is the direction in wich you should go with joal development. If I can help i n any way I would be glad.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #3 - Posted 2006-01-31 01:32:52 »

I made my code work in another way. i just added ALut.alutInit() after  AudioSystem3D.init(); and it works  now. Which way is right way, my or yours?

That will have the side-effect of working but the more correct way given the current Sound3D APIs is to manually create the Device and Context and make the Context current.

Quote
I foud sound3d package very helpfull and much cleaner designed for use in java apps.

as java programer I  prefer calling methods like   AudioSystem3D.getListener().setPosition(0, 0, 0);  then AL10.alListener(AL10.AL_POSITION, listenerPosition);

I think that is the direction in wich you should go with joal development. If I can help i n any way I would be glad.

Agreed that it's a cleaner, more object-oriented API. If you have suggestions for how to improve the API please post them.
Offline bigor

Senior Newbie





« Reply #4 - Posted 2006-01-31 10:20:54 »


Quote
Agreed that it's a cleaner, more object-oriented API. If you have suggestions for how to improve the API please post them.

For now I don't have suggestions, It is really good and simple.
I am bit confused with versions, because I recently downloaded joal1.1b0.4, but now I see joal1.1b01 as latest release...
Another thing that bothers me is that javadoc for joal1.1b0.1 doesn't contain sound3d package doc. Why is that so?
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #5 - Posted 2006-01-31 18:25:59 »

I am bit confused with versions, because I recently downloaded joal1.1b0.4, but now I see joal1.1b01 as latest release...

Sorry for the confusion. I think we need to reset the version numbering because the old autogenerated binaries were incorrect and "1.1" is the best version number to indicate that JOAL has been upgraded with OpenAL 1.1 support.

[qupte]
Another thing that bothers me is that javadoc for joal1.1b0.1 doesn't contain sound3d package doc. Why is that so?
Quote

Sorry about that, just a bug. I'll fix it.
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 (18 views)
2014-07-24 01:59:36

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

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

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

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

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

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

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

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

Riven (50 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!