Home » Community » Forums » » A Guide To Starting With OpenAL
  Intel sponsors gamedev.net search:   
[Control Panel] [Register] [Bookmarks] [Who's Online] [Active Topics] [Stats] [FAQ] [Search]

Add Forum to Favorites |  Send Topic To a Friend | View Forum FAQ | Track this topic


 Last Thread Next Thread 
 A Guide To Starting With OpenAL
Post Reply 
Hi people,

I've checked out today the CVS version of OpenAL. The library itself compiled succesfully but I can't link the testing programs and my own program.

I'm getting the following error:



cc -I../src -I../include -I../../include -I../audioconvert -g -O2 -fPIC -Wall -W -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wimplicit-function-declaration -Waggregate-return -Winline -Wpointer-arith -fno-common -ansi -Wno-redundant-decls -Wno-unused testreverb.c -o testreverb testlib.o -L../src ../src/libopenal.a -ldl -lm -lpthread -lasound -lvorbis -lvorbisfile
../src/libopenal.a(posixthreads.o)(.text+0x1e0): In function `Posix_AtForkThread':
threads/posixthreads.c:109: undefined reference to `pthread_atfork'
collect2: ld returned 1 exit status


I don't understand this because I'm linking pthread with the programs:

makefile of the test programs:

*snip*
INC=-I../src -I../include -I../../include -I../audioconvert
LIBOPENAL=../src/libopenal.a
LIBS=testlib.o -L../src $(LIBOPENAL)  -ldl -lm -lpthread -lasound -lvorbis -lvorbisfile
MAKE=gmake
*snip*
 


the same result with the makefile of my test program:


OBJECTS = thortest.o
INCLUDES = -I.

all: $(OBJECTS)
   g++ $(OBJECTS) -L/usr/local/lib -L../lib  -lthorss -lopenal -ldl -lm -lpthread -lasound -o thortest

thortest.o:        thortest.cpp
               g++ -fPIC -Wno-deprecated $(INCLUDES) -c -g -MD thortest.cpp
 



Does anyone know what I have to do to solve this problem ??

Bye, Alex

Check out TheTool: thetool.polyfrag.com

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Wow! That's a very good article imo, it made OpenAL seem 100 times easier than when I tried it out some time ago

Damn nice!

 User Rating: 1050   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

I have two questions: First, what sound formats are supported by OpenAL. Yeah, I can find that in the SDK, but I think it's a -general- enough enquiry that it deserves to be told to everyone clear out.


Second question is functional: How do you play a non-3D sound?
A menu click, Cortana speaking in your headphones, background music, etc...
And if you build a stereo sound, how does it behave with 3D positioning (or non-3D) in OpenAL?



 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

OpenAL only has a built in function to load .wav files right now, though Ogg support is on the way. And to make a non spatial sound, simply make it stereo. Spatial sounds must be mono.

 User Rating: 1015    Report this Post to a Moderator | Link

My personal experience with OpenAL is that it was quite convoluted to use.

I personnaly prefer fmod or bass both of which seem to offer more features with a much simpler api (plus a smaller runtime dll).

Have you used either of these api's and can offer any comparison to compel me to change.

** Please note i dont want to start a "which is the best api" debate. I just wondered if you have used them and how you rate them against OpenAL.


 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Forgot to mention.. Very good article .. totally agree with BauerGL sentiments.

Steve

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

nomore_pf:
Check out the archives on the mailing list. I remember there were one or two other people having the same problem. Don't remember the fix for it though.

Spacecat:
OpenAL turthfully does not have inernal support for anyformats. The WAV loading is done via ALUT and OGG support is only a linux extension. You can play any format of file you want as long as you know the file format. If you know how the header and data are organized and how to decompress it, you can send that to the buffers and it will play just fine.
As far as the non-3D sound, just set a source up somewhere around the listner and make its position relative to the listner. EX: Set the souce say, 3.0f relativly behind the listner. If the listner moves 100.0f forward, the source will stay 3.0f behine the listner and move with it.
Does that make sense?

leehairy:
Although I personally (and I know it was not directed towards me) used either of those librarys, they wouldnt work for the projects I am doing. I need cross platform, and 3-D comes as a bonus. My understand of those to libs is they are windows only. And as far as size goes, use UPX, It cut the SDL lib from about 220k+ down to 88k and it still works great.

I do have to admit it is a good article. My only complaint is the use of Alut but that is the easiest way to do it. But then again, I also did enjoy the hard way.

 User Rating: 1020   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Regardless of how good the fmod (I love that one) and bass are, they aren't free for use in non personal applications

I'm glad to have run across such a nice tutorial... I'm a bit concerned with the current state of openAL. Is it still being developed? I mean, I've been finding articles about it from 2000, and it doesn't seem to have progressed much. I keep finding all sorts of broken links when searching for info about it as well. I'd really like to use it as it's cross platform and completely free
but does anyone know whether this is going to be a growing system, or will just fade away?

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

It still is in development but some of the main developers are at Creative. For the main information, you always have openal.org and the mailing lists. It used to belong to Loki before they went under.

 User Rating: 1020   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

I would like to say this is a good article. WHen OpenAL was version 1.0, it worked perfectly, using alutInit() to initialize everything. Later, after a hard drive crash(blah), I got version 1.1, and it no longer worked, using the code in this article. But yet, I never got any errors using alGetError either. The demos all worked fine though. To fix it, I switched away from the alutInit() function and begun to use the alc functions to get the device and context, as well as to destroy the above as well. Then it worked perfectly. I don't know what the change was, but to anyone else having problems, try that. The article was good anyway though.

 User Rating: 1162   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

ya, i'm getting all kinds of errors such as these when building the main.cpp file..although none during compilation..

main.obj : error LNK2001: unresolved external symbol _alutExit

i'm new to this..so any help about changing things around would be great..i only have a simple WAV file that has to be played.

 User Rating: 1015    Report this Post to a Moderator | Link

good tutorial
got it working in seconds, FUCK SDL_MIXER

 User Rating: 1015    Report this Post to a Moderator | Link

I can't get the sounds to play. I downloaded a different tutorial from somewhere else and couldn't get it to work either. What's weird is that the executable that came with the download worked as it should. But when I loaded the project that came with it in Visual C++ and compiled it without changing a thing, my version wouldn't work.

I did kind of change a line in alut.h that came with the SDK. See, when I threw the library files that came with the SDK in C:/Program Files/Microsoft Visual Studio/VC98/lib and the includes in VC98/Include/AL, and then tried to compile it, I got this error:

c:\program files\microsoft visual studio\vc98\include\al\alut.h(4) : fatal error C1083: Cannot open include file: 'al.h': No such file or directory

So I checked line 4 of alut.h and this is what it had: #include . So I changed that to #include "al.h" and then it worked. I don't really know the difference between the arrow brackets and the quotes, but could that be whats making it screw up? And why wouldn't it work when it was #include ?

So anyone know what's wrong or how to fix it?

 User Rating: 1015    Report this Post to a Moderator | Link

Grr dang html. What it had on line 4 was this: #include <al.h>

 User Rating: 1015    Report this Post to a Moderator | Link

All times are ET (US)

Post Reply
 Last Thread Next Thread 
Forum Rules:
You may not post new threads
You may post replies
You may not edit your posts
You may not use HTML in your posts
Jump To:
Administrative Options: