In our game we have moving game objects with a looping sound that periodically fly past the player. Now I want to control the volume by making the object quieter when it flies past the listener. So when the object flies towards the listener, I want to have a louder volume than when it flies away from the listener.
In FMOD, there is a very cool feature called Doppler Effect that controls the pitch in exactly the same case. So I wonder if I have access to this control parameter in FMOD Studio. If I’m not mistaken, the value should be velocity relative to the listener, with positive and negative values. Unfortunately, I can’t find one among the built-in parameters.
Another possibility would be to use the two built-in parameters direction and event orientation. With these two values I can find out if the object is coming towards me or has already passed, but to do that I would have to sum the two values, which I can’t do in FMOD Studio.
The game is being created in Unity, so it wouldn’t be a big deal to get these values/information from a programmer, but since FMOD Studio obviously already works with the values internally, I figured there might be a way to get them.
I’m a bit confused. What is the issue you are experiencing?
To use the Doppler effect in Unity you will need to enable it on the Event here:
And ensure that the object with the event has a Rigidbody on it.
Hope this helps!
Hi, sorry for the confusion. I will try again:
Doppler effect is already implemented and works very well:
Object flies towards the listener → pitch is higher.
Object flies away from the listener → pitch is lower.
Now I want the same scenario with volume control:
Object flies towards the listener → volume is higher.
Object flies away from the listener → volume gets lower.
My specific question is if there is a built-in parameter in FMOD Studio that allows me to control the volume the way the Doppler effect does with pitch.
I hope it is clear now
Thanks a lot and best regards
Thanks for clearing that up.
I think something that might fit is the Spatializer (FMOD Studio | Glossary).
Let me know if that is what you are looking for.
Hello, no, not really. The spatializer works with distance. For the Doppler effect you need a relative velocity and I would like to use the same parameter for a volume control.
FMOD would need to use this parameter internally to calculate the Doppler effect. Hence my question if there is any way to retrieve this value without coding. If there is no way to access this parameter in FMOD Studio, I need to ask a programmer to calculate it and send it to the event.
To better understand my intent, I have created a simple sketch of my scenario:
We have a player/listener in the first person perspective who is under fire from the enemy. The bullets fly at moderate speed and the player must dodge them. Since there can be many bullets, I need to clean up auditory perception, so I want to make the bullets that have passed (right) quieter than the bullets that are still flying towards the player (left). In the sketch you can see that in this snapshot the left and right have the same distance, so the spatializer doesn’t work. Thats why I need information about the relative velocity to control the volume, similar to the Doppler effect.
Apologies for the misunderstanding, the diagram was super useful.
Try using the built-in
Direction parameter to automate the volume with a curve looking like this:
This will keep the event at full volume while it travels towards the listener, then reduce its fader once it has passed. You could further improve this via code using the
Distance to add further modulation to the volume.
Hope this helps!
Yes, I have tried this approach as well. The problem is when I look in a certain direction and the projectile comes from behind, it doesn’t work.
In the meantime, I found out that I can create a custom parameter and add the
event orientation parameters as automation to the value. Now I get the information when the projectile is looking in my direction, whether it is in front or behind me and I can control the volume. This is a good workaround. Thanks for the help though.
Thank you for sharing your solution