# FMOD and augmented reailty

This topic is 3669 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 on other sites
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 on other sites
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 on other sites
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 on other sites
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 on other sites
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 on other sites
Or play the sound as 2d. Set the individual output volume of the sound per speaker yourself... I don't see any reason you'd have to modify fmod.

Cheers
-Scott

##### Share on other sites
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 on other sites
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 on other sites
 (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

1. 1
2. 2
Rutin
18
3. 3
khawk
15
4. 4
A4L
14
5. 5

• 10
• 13
• 26
• 10
• 11
• ### Forum Statistics

• Total Topics
633744
• Total Posts
3013666
×