Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
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  
  Using openAL  (Read 1591 times)
0 Members and 1 Guest are viewing this topic.
Offline darcone

Junior Member




Size matters


« Posted 2003-04-04 11:46:53 »

I tried using the skeleton code for openAL but these lines didnt make any sense to me or the compiler:

//create one IntBuffer as buffer and one as source
 IntBuffer buffers = createIntBuffer(1);
 IntBuffer sources = createIntBuffer(1);

Also, is it hard to load orbis files instead of wave files? I want to have one stream with background music and one to play effects... can you mix it that way?
Any code samples would be appreciated Smiley
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #1 - Posted 2003-04-04 12:27:18 »

Quote
but these lines didnt make any sense to me or the compiler:

It's just a utility method located in:
org.lwjgl.test.openal.BasicTest
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
    /**
     * Creates an integer buffer to hold specified ints
     * - strictly a utility method
     *
     * @param size how many int to contain
     * @return created IntBuffer
     */

    protected IntBuffer createIntBuffer(int size) {
        ByteBuffer temp = ByteBuffer.allocateDirect(4*size);
        temp.order(ByteOrder.nativeOrder());
       
        return temp.asIntBuffer();
    }


Quote
Also, is it hard to load orbis files instead of wave files?

Nope - however oal only plays PCM audio, so you need to decode the ogg files to PCM first, and then load them directly:
Go to http://www.jcraft.com/jorbis/index.html and download the jorbis package
Familiarize yourself with it
take any ogg file, and decode it using the VorbisFile class - save the raw data, and play that directly with openal.

http://sourceforge.net/projects/spgl also have some OpenAL stuff in there...(http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/spgl/spgl/src/com/shavenpuppy/jglib/sound/)

hope this gets you started

Offline darcone

Junior Member




Size matters


« Reply #2 - Posted 2003-04-04 13:41:40 »

Ok, thanks Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

JGO Kernel


Medals: 378
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2003-04-04 17:27:14 »

Jorbis has become part of the SPGL now Wink All the sound in A.F. is oggs.

Cas Smiley

Offline darcone

Junior Member




Size matters


« Reply #4 - Posted 2003-04-06 11:00:48 »

I think I could use to write something simple myself really... Not that I dont like your work princec but I think using lwjgl is just enough, otherwise my software will be mostly written by you Smiley
Offline princec

JGO Kernel


Medals: 378
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #5 - Posted 2003-04-06 12:31:48 »

Soon ALL software will be written by me! Muahahaha! (etc)

Cas Smiley

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.

BurntPizza (19 views)
2014-09-19 03:14:18

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

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

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

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

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

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

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

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

Longarmx (36 views)
2014-09-07 01:10:19
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!