3d sound source scene node with OpenAL

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

is this node useful to you?

yes!
29
85%
no!?!
5
15%
 
Total votes: 34

buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

3d sound source scene node with OpenAL

Post by buhatkj »

Like the title says, I made one :-)
You can download it here http://fmorg.sourceforge.net/tempstuff/3dSoundDemo.zip

I would love any feedback, let me know what is good, what is bad, what is missing, etc. I will check this thread.
Enjoy!
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
Guest

Post by Guest »

it works for me here!

just a few questions:

1. do you have to recompile irrlicht for that? it would suck because everytime a new irrlicht version comes out you have to add the code

2. do you need the 2 openAL dll´s or is it possible to include them in the app? (static)


nice work man! :)
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

response to questions...

Post by buhatkj »

Thanks GFXstyLER :-)
1- No, it doesnt require a recompile to irrlicht, it is written much the same way as the custom scene node tutorial or the CCloudSceneNode - that is, it is an add-on which you must include along with irrlicht in your application.

2- I don't know if there is a static library version of OpenAL, perhaps if a person was so inclined they could compile openAL as a static library and use that instead of the DLL's, that might result in a very slight speed improvement due to not needing to dynamically link at runtime, but I'm not sure it would be worth the trouble...

I would like to try and have this code work everyplace irrlicht does (ie. LINUX) so one of the other things I may improve in the future (in addition to added features and stuff) is to add a kdevelop project or makefile for linux and whatever code changes (if any) are needed to make it work there also. OpenAL supports OSS and ALSA so it should be possible....

On a not-quite-related note. I have been thinking lately, that it might be possible to do simple solid-body physics with a custom irrlicht animator..
thoughts?...has somebody already done this?...
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

works ok, but got a bit confused by not having any point of reference (as a 3d model) to orient myself in space.

Acki had already written a good example for openal some time ago. I made a modded version based on it here:(open al include and lib folders are linked externally)
http://www.danielpatton.com/afecelis/files/OpenAl.zip
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

good point...

Post by buhatkj »

good point afecelis-
I will try to add a test scene node or something attached to the sound source so that you can see visually where it is - and also useful would be maybe a movable camera, to which I could attach the "Listener".

thx for the suggestion :-)
-Ted

-EDIT-
I tried out your modded version of acki's demo. It works very nicely, but I kinda like mine better because it uses a scene node instead of a custom function to update the position. I just really like the irrlicht scenegraph so I think i'll stick with that. As I did in my demo it lets me even use irrlicht's existing animators to move my sounds around. I think once I add a point of reference as you suggested the advantages of using a scene node for this will be more clear.
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

great! if you make it a custom node then it will be much easier to set up environmental effects! :D

I'm glad the suggestion worked.

how about triggerable sounds? Would it be possible with your node?
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

triggers....

Post by buhatkj »

might be able to do that with some sort of sound even listener thinger that would work with the sound driver class i wrote...
you would need to pass events to it in your event reciever similar to how you pass them to a camera, and you would need to define sound events somehow.
I'm not 100% on how I would do this but it is also a good idea.
I will try to look into it.
-Ted
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

I have updated the download!!

Post by buhatkj »

I added an environment, and visual references with spiffy labels for the source and listener. the demo now much better demonstrates the 3d sound :-)
here is the download link again:http://fmorg.sourceforge.net/tempstuff/3dSoundDemo.zip

Some things still need work, like the somewhat clumsy handling of the rolloff factors and reference distances...

Special thanks go to afecelis for his wise suggestions :-)
Enjoy!

PS-sorry it took so long, i just dont have a lot of time to work on this stuff...
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Nice work buhatkj!

A much better example to understand your concept, although I'm not getting any sound played at all.
I get a : "trying to play soundid:1" message.

perhaps I'm missing somethng? :wink:
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

no sound...

Post by buhatkj »

I dunno, it seems to work on my machine...
I had a problem before with openal, where the same code worked great on my one machine, but on my other, i had no sound.
audiere worked great on both, but audiere has no 3d...
I think maybe openal (or the options i am running it with?) isnt fully compatible with some sound cards/drivers. I will try this out on other machines, and see if i can duplicate your trouble.
BTW, the "trying to play sound id: 1" message is totally normal, it isnt output from error checking. perhaps if i did add some more error checking you would get more useful debugging output...I will give that a whirl if i can duplicate the problem.
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

works on both machines...

Post by buhatkj »

I'm not sure what's going on, I've tried it on all my machines, and it works, though it is sort of quiet. I need headphones to really hear the effect, probably just how i'm handling the distance and rolloff factors, but it does sound right on all my PC's.
Has anyone else tried this besides afecelis? what were your experiences?
Also, Maybe what sound card and OS do you have?
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

I've got same resul like afecelis.
No sound. Maybe must install OpenAL again??
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Post by MikeR »

It worked fine for me. I'm wondering if it's looking for the dlls in the "proper" folder instead of the project folder?
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

MikeR's theory

Post by buhatkj »

MikeR makes a good point... So, I uploaded the openAL redist installer to here:
http://fmorg.sourceforge.net/tempstuff/OpenALwEAX.exe
Afecelis and etcaptor: could you try installing it and let me know if that fixes it?
Thanks :-)
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

@ buhatkj, I go back to developing of my openAL scene node and found the reason for unwished sound effects. just take a look on yours, but suppose that you will have the same problem. Attach listener to any fps camera and try whether sound is coming from right location. The main reason is that Irrlicht and OpenAL uses differents coordinate system. If I not mistake, but take a look here:

Image

Also maybe any euler transformations for orientation are needed.

@Alvaro, I have not idea why in your example are divisions like /100
Last edited by etcaptor on Sat Oct 08, 2005 8:34 am, edited 1 time in total.
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
Post Reply