Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (707)
Games in Android Showcase (208)
games submitted by our members
Games in WIP (781)
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  
  a couple audio questions  (Read 1995 times)
0 Members and 1 Guest are viewing this topic.
Offline weston
« Posted 2005-03-05 16:57:43 »

I'm doing some stuff with openal and I seem to have run into a couple problems. First of all, my programs that use OpenAL don't work on laptops (and probably other computers that don't have decent soundcards), Is there another dll or something that I need to package with my game in order for OpenAL to work in software?
  The other problem I'm having is with AL_EXT_vorbis, I have an Audigy2 and the creative labs website tells me that my drivers are up to date yet I can't get it to work. I read somewhere that you need libvorbis.dll in order for it to work, but I can't seem to find this anywhere... Could I have some more information about what this file is, where I can get it, and whether it is ok for me to package it with my game or not.

  I'm also wondering whether I'm going about this OpenAL programming correctly since I can't seem to find any example code that does something similar. In order to find out how many sources the user's hardware supports, I have a loop that will run 128 times (maybe it should be 64) or until OpenAL gives me an error and creates one source during each iteration, this piece I got from one of the lwjgl demos. It seems like there would be some way to just ask OpenAL how many are supported...
  While I'm figuring that out, I store all the sources that are created and create no more from that point on. What I do instead is have a class that manages those sources and before I play a sound, my SoundClip class (which has an x,y position, pitch, buffer, etc.) asks this other class for a source and attaches a buffer to it and sets the other required attributes. Is some part of this going to be slow? Attaching the buffer and setting the other attributes for the source before I play it each time I mean. Btw, I'm doing this because I don't want the sound to restart if is called again while the sound is still playing.
  My class that stores all the sources (clips request a source from this class before playing it) sorts all of the sources by their distance from the listener, then by their 'priority', and finally by whether they are actually playing or not. After they are sorted, the first source in the array is returned if its priority is <= to the priority of the SoundClip that is requesting a source, otherwise -1 is returned. One of the problems with this is that I don't know how to actually check if a given source is actually playing or not... is there a way to do this? I'd be interested in hearing any other comments on my process (particularly about whether I'm doing everything completely wrong or not Tongue ).

for(int i = 1; i > 0; i++)
     System.out.println(i+" cups of java downed");
Offline tom
« Reply #1 - Posted 2005-03-05 22:24:58 »

There is no way to query how many sources that are available. Creating one and one and checking for error is the only way. It is common to create all the sources needed at startup and mange those during the game.

Don't think setting buffer and other attributes are slow. It is not like you are doing that as much as binding textures Wink

You can query the state of a source:
AL10.alGetSourcei(sourceLine, AL10.AL_SOURCE_STATE) == AL10.AL_PLAYING

You can get the OpenAL documentation at

Offline weston
« Reply #2 - Posted 2005-03-05 22:42:01 »

ah thanks for that. I actually did know about the documentation and I've read a fair amount of it, but its a large document when you looking for something specific and I couldn't seem to find anything on querying source states.

p.s. Thanks for writing OggInputStream Cheesy I was really hoping I could find something to use like ov_read from the devmaster OpenAL ogg streaming tutorial (

for(int i = 1; i > 0; i++)
     System.out.println(i+" cups of java downed");
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline weston
« Reply #3 - Posted 2005-03-08 00:40:03 »

hmm, anyone know about libvorbis.dll or running OpenAL in software? *cough* Matzon *cough* Grin

for(int i = 1; i > 0; i++)
     System.out.println(i+" cups of java downed");
Offline Matzon

JGO Knight

Medals: 19
Projects: 1

I'm gonna wring your pants!

« Reply #4 - Posted 2005-03-08 03:32:18 »

the vorbis extension for openal is flaky at best at the moment. Your best option is to use jorbis - either manually or using the OggInputStream (probably the easiest).

As for running OpenAL in software - I am not sure about what you mean? - OpenAL (if you use the one we use) will use the DirectSound3D backend which is typically hardware accellerated.

Offline weston
« Reply #5 - Posted 2005-03-08 18:34:56 »

I'm using OggInputStream for streaming large audio files and I have another method for decoding an entire ogg, but I only use that if AL_EXT_vorbis is not available because it could be potentially faster at some point (decoding done in hardware?).However, I can't seem to get AL_EXT_vorbis working on my computer and I have a fairly new card Sad I tried looking for information on google and read something about needing libvorbis.dll, but couldn't find any more information on it. I did find the libvorbis.dll source, but I've never written c/c++ and have no idea how to compile etc.

Ok, I can give up on AL_EXT_vorbis, but I need audio to work on most every computer and I havn't been able to get openal working on a single laptop and some desktop computers. I assume this is because they have crap soundcards, but I thought there was a 'software' implementation of OpenAL that should work everywhere... I would like to be able to use this if the hardware support isn't available. I'll have to double check, but I'm fairly certain puppygame's games work on some of the laptops where my openal code failed... so I feel like I'm missing something.

for(int i = 1; i > 0; i++)
     System.out.println(i+" cups of java downed");
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Galdo (413 views)
2017-01-12 13:44:09

Archive (568 views)
2017-01-02 05:31:41

0AndrewShepherd0 (1041 views)
2016-12-16 03:58:39

0AndrewShepherd0 (965 views)
2016-12-15 21:50:57

Lunch (1097 views)
2016-12-06 16:01:40

ral0r2 (1332 views)
2016-11-23 16:08:26

ClaasJG (1426 views)
2016-11-10 17:36:32

CoffeeChemist (1413 views)
2016-11-05 00:46:53

jay4842 (1497 views)
2016-11-01 19:04:52

theagentd (1251 views)
2016-10-24 17:51:53
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 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!