I have openal working with OF, but I had a hell of a time getting the libraries to compile into BSD static libs and eventually just went with the framework versions of openAL. The simple little sample I whipped up is here http://thefactoryfactory.com/openal/openALExample.zip but I think it’d be useful for people to have a real lib. I’m also relying on the old alut calls, which I’m gonna clean up tonight, but openal is nice (nicer than rtAudio maybe I think?). Anybody else like openal? I saw an older thread on it, but no news lately
I’ve successfully used openAL in a Linux based project before, but it’s a very different beast to rtAudio. It’s much closer to FMOD, in fact, it’s the only real open source alternative to FMOD that I know of. OpenAL has been principally designed for 3D audio, whereas rtAudio is a callback based audio API designed mostly for DSP applications.
Also keep in mind that at the moment OF is more a 2D library than a 3D one I think.
FMOD is definitely more advanced than openAL, and I think openAL is biased towards Windows (better supported on that platform) due to the relationship it has with Creative Labs and Windows gaming. You’re on a mac, right? Probably explains the trouble you had compiling it.
Another thing about openAL is you have to implement stereo panning manually.
OpenAL does not spatialize stereo samples or streams and therefore does not apply any 3D properties to these sounds (such as panning, distance attenuation).
Still, openAL is one of the better candidates to replace FMOD in OF, if the project is to go truly open source.
btw I think rtAudio is not showing its true abilities at the moment; it may need some re-vamped examples to show the cool stuff you can do at the sound buffer level…
Well, the problems I had were getting it compiled into a static lib, it comes installed on the Mac. After a little more reading I think in terms of what it does, it’s a pretty different beast than rtAudio, but one that I think would be good to add to of as an addon given the ease of working wtih multiple 3d sound sources.
I definitely think it would be great as an addon, or even a replacement for FMOD. At the moment however, FMOD does everything openAL does and more. It’s just that the OF example doesn’t show FMOD’s 3D capabilities off. FMODex has great stuff like geometry occlusion, a multifx suite including some good reverbs, sound virtualization and heaps more…
How about making an OF, openAL + 3D physic demo
That would be cool!
I like OpenAl because it is open source, and cross platform. I just don’t like to worry about licensing fees and the such. Here is a cool little tutorial page for OpenAl I found…
It has 8 lessons. Number 8 even shows how to get mp3 playing using oggVorbis.
A very cool API with no licensing fees. I think I would prefer it over fmod just for the piece of mind.
BTW how is that ofOpenAl addon coming along.
Well, getting OpenAL plugged into OF isn’t hard, but I got distracted by making a 3d selectable model that would allow you to position different sound sources in 3d using fmodex (as grimus suggested) and then I got distracted by Arduino…so, yeah. That’s about where it is. Proof of concept.
Hey I’m the king of getting distracted so I know what you mean
Just to clarify this:
Number 8 even shows how to get mp3 playing using oggVorbis.
oggVorbis is not the same thing as mp3, although it does provide a similar and possibly better method of compression. However you wouldn’t be able to use .mp3 files in OpenAL using this technique.
OpenAL has an mp3 extension, but I’ve found nothing to indicate what it actually does:
The only example of OpenAL + mp3 that I’ve found on the web is in Pascal using the mpg123 library. Source code is in this thread:
My bad. You are right. Sorry I guess I got overly excited. What I meant was…
Number 8 even shows how to get oggVorbis files playing.
hi - just discovered this sound code in blender:
that sits on top of either openal, fmod and sdl mixer (and even provides an interface for a dummy device, for you to fill out). problem is that the blender code is gpl, but it could be nice as an alternative sound system for playing samples. maybe an addon for those that are concerned about using fmod? also, the openal code might be a good starting point…
It looks good, but I also think that it wouldn’t be too hard to write a similar sound layer from scratch…it’s just doing some sample management and connecting up the relevant API’s. The openAL code would be useful, but I think it’s not that different to a lot of stuff out there on the web…so LGPL could certainly be an option…with the exception of FMOD of course. I’d be up for this task, but it’s a bit of work…I’ll see if I can’t sneak it into my workload at some later stage.