Sign in to follow this  
RP520

FMOD and augmented reailty

Recommended Posts

RP520    122
Well, last time I posted here I got a lot of useful information so I am back. I am using FMOD to do 3D sound. I am working on an augmented reality game that is played on a desk. The sound setup currently is four speakers on each corner of the desk. What I want to do is have sounds play louder the closer they are to a speaker. So for example lets say I have my Front Left Speaker at position (x,y) of the table, when an object gets closer to the speaker I need sound to get louder on that speaker only. If I then move it towards the Front Right Speaker the sounds should get quieter on the front left and louder on the front right. In this way the position of the listener doesn't matter since the sound is played based on where the object is compared to the speakers, rather than playing the sound based on where the object is compared to the listener. Is there any way to accomplish this? It doesn't seem like too difficult a concept. I've searched for the last few hours with no luck.

Share this post


Link to post
Share on other sites
calav3ra    127
thats simple 3d sound that you get with every soundlibrary these days. just do something
like fmod->play3d( filename, position) and be sure to update the position for the sound. that should be tutorial #1 or #2 for all soundlibs ;)

write back and good luck,
cal

Share this post


Link to post
Share on other sites
popsoftheyear    2194
Yeah it's actually making things simpler not more complicated... think of it like this:

When you are positioning sound around the listener, you check the sound's position, subtract it from the listener's position (thus transforming it into speaker-space (??)), then play it.

To position it based upon the speaker position, remove the listener transform step, and it gives you a simple play-the-sound-wherever it is.

Now I'm not sure about what you described, but if the speakers can have x, y positions, you may also want to do a simple bilinear interpolation on the sound position and use the results to determine the level for each of the 4 speakers. I would be dissappointed if fmod didn't offer functionality to set up speaker position directly though - I'm 99.9999% sure it does.

Cheers
-Scott

Share this post


Link to post
Share on other sites
RP520    122
Its not as simple as it sounds. If I set the position of the sound as it is in the environment and change the position of the sound it is played on the speakers as it relates to the listener.

I want the sound to change as it gets closer to the different speakers in the real world. The problem arises because I have to state where the listener is and the sound changes based on where it is in relation to the listener rather than in relation to the speakers. Its a little hard to explain in words, so hopefully I am getting my point across, sorry if I'm not.

I'll try that Scott I replied before you posted.

Share this post


Link to post
Share on other sites
RP520    122
Upon closer look, it should work, but was kind of hoping there was a way to do it without having to completely recompile fmod. I don't know how I can remove the listener transform step.

Share this post


Link to post
Share on other sites
popsoftheyear    2194
Recompile fmod? You can obviously set the listener position in fmod right? So set it to (0, 0, 0) or (0, 0) if in 2d... thus eliminating the need to transform to the listener's position... or at least making it not do anything...

Is there some reason that won't work?

Share this post


Link to post
Share on other sites
RP520    122
That did not work. Thing is it still translates the sound based on the user being at the origin. So if I move the object away in any direction it gets quieter.

Share this post


Link to post
Share on other sites
RP520    122
It seems like I may have to do it manually like you said. I just wanted to exhaust my resources to see if it had that capability already and I was just missing something simple. I also posted directly on the FMOD forums, but so far there hasn't been a reply.

Share this post


Link to post
Share on other sites
popsoftheyear    2194
[edit] (removed a silly question) nevermind I get it. [/edit]

Ok yeah from what you describe you will have to do it yourself... you essentially want each speaker to be it's own listener in a manner. It still shouldn't be very hard. Some sort of bi-linear/cubic/whatever interpolation will work perfectly.

Cheers
-Scott

Share this post


Link to post
Share on other sites
RP520    122

<edited out the answer to your question>
Still, if anyone knows something about FMOD I have overlooked your response would be extremely helpful.

Share this post


Link to post
Share on other sites
RP520    122
UPDATE:

Alright kind of interesting and maybe point someone in the right direction to point me in the right direction. In FMOD I created 4 listeners and positioned them at virtual positions where my 4 speakers are, if it gets close to a listener it plays the sound relative to how close it is to the listener. Works great, but and heres the annoying part, if the sound gets close to any listener then it plays on all the speakers. Meaning I need to somehow direct what the listener is hearing into a specific speaker.

Share this post


Link to post
Share on other sites
calav3ra    127
just to come back to your original problem. what you wanted was to
hear the direction but make the distance play no role.

so just set up one listener and use vec3/vec3.length so get a unitized
vector.

maybe that helps

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this