Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (116)
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  
  a couple audio questions  (Read 1329 times)
0 Members and 1 Guest are viewing this topic.
Offline weston

Junior Member





« 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 clip.play() 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:
1  
AL10.alGetSourcei(sourceLine, AL10.AL_SOURCE_STATE) == AL10.AL_PLAYING


You can get the OpenAL documentation at www.openal.org

Offline weston

Junior Member





« 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 (http://www.devmaster.net/articles/openal-tutorials/lesson8.php).

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

Junior Member





« 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

Junior Member





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

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

radar3301 (12 views)
2014-09-21 23:33:17

BurntPizza (30 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (28 views)
2014-09-20 20:14:06

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

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

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

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

Tekkerue (50 views)
2014-09-09 02:24:56
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!