What is the simplest way to add "whoosh" sounds to objects as you fly past them?

I have an fmod event, with a looping whoosh.

I have a “built-in distance” parameter, opening low and high pass filters to create a cool effect as you get close to it, and

a “built-in speed (relative)” parameter, controlling the volume, so the whoosh shouldn’t just continuously play when you are sitting still next to the object.

But for some reason I cannot get sound out of it.

Is this how I should be going about creating this passing whoosh effect, or is there a better way? (keep in mind I am the helen keller of scripting)

Have you set the event to be persistent? The button for doing so in the macro controls section of the deck when you select the event in FMOD Studio. I ask because it sounds like the event might be stopping itself before it plays if none of its instruments are triggered at that point.

Thanks for the response Joseph, yes persistent is set to on already… hmm

How are you triggering the instrument?

Have you tried recording a session in FMOD Studio’s profiler window while connected to your game using live update?

hey joseph, so I saw that it was definately being triggered in the profiler.

I managed to get it working with the built in distance parameter, it works great.

But I can’t get the built in speed parameter to work, so the whoosh just continuously plays. I’ve set a relative speed parameter to control have the volume at 0db at 0 speed, and full volume at 10 speed, but sitting completely still next to an object that is also still, and the volume is still staying at 0.

I also tried with the absolute speed but same thing.

If you have any ideas on this I’d really appreciate it.

I’m afraid I don’t understand the problem. If you have automated the volume on the speed built-in parameter such that the volume is 0 dB when speed is 0, and the listener is sitting still next to an emitter that is also still, then the relative speed of the emitter is 0, and a volume of 0 dB is the expected behavior. Since that’s the volume you’re observing, what’s the problem?

There are two apporaches that I used and other games also use. Maybe there are more but these work very well:

  1. You place overlap spheres in your game and when either your pawn or your camera overlaps the sphere you play the woosh sound at the center of the sphere. you can interpolate the volume depending on the speed, you don’t need much else.

  2. all objects you “woosh by” have a simply collision around them that you can trace for. I would eg. trace in a sphere from the left and right of your pawn or camera so you don’t miss an object at higher speeds. Ss soon this trace hits the objects play the woosh sound at the location of the object. you can change some location params, eg. you can set the height of the sound to the height of the trace hit.

All in all i would set the distance volume falloff to something like 25m or so.

1 Like

Ah sorry, the problem is that the built in speed parameter is never leaving 0. Even at high speeds the volume stays at 0. It’s like fmod thinks the listener isn’t moving

When your game’s code changes the position of the emitter and listener, exactly how is it setting the event’s velocity?

I ask because we support changing an emitter or listener’s position without setting its velocity in order to allow things to “teleport” without causing sudden spikes in the event instance’s speed built-in parameter or Doppler effect. If your code is setting the emitter or listener’s velocity to 0 or null, that could explain why the speed built-in parameter isn’t being updated correctly.

1 Like

Yeah this is interesting, thanks!
I can see this being more efficient than my idea with the continuous ‘whoosh’ loop. I’d still like to see if I can get it working that way with the built in speed parameter too.

I love how simple your first approach sounds. When you say “overlap spheres” do you mean like, collision spheres?.. what exactly are overlap spheres?

At the moment, my programmer says she is manually positioning the camera every frame. She asked, "is it intended that I feed in the velocity value to the listener manually, or does the listener automatically look for a rigidbody or something to listen to?

Are you in unreal engine or unity? i could help particularly on unreal engine but the concept is always the same regardless of the engine. example:

if you have a streetlamp you would like to have the whoosh sound played at you place a giant sphere with eg. a 25m radius at its pivot. you can only trace for it but not actually collide with this sphere. as soon your car OR you camera starts overlapping the sphere you place the woosh sound at the pivot of the sphere. the distance to the pivot automatically regulates the volume of the woosh sound. the sound is a fire and forget, it is automatically destroyed after it finished playing. you can additionally decrease the volume by the speed of your car. eg. you inverselerp the car speed between 5m/s to 30m/s and clamp the output to [0, 1].

Yeah Im in unity hehe, cheers man. This is great info.

Either way I need to figure out how to get this speed parameter working.

Sorry to nudge you joseph hehe, are you able to send me to any info on my previous question?

FMOD Studio has no concept of rigid bodies; those are a feature of your game engine, not of the FMOD Engine. The only place the FMOD engine gets the 3D attributes of listeners and event emitters is the API calls your game’s code uses.

Hey thanks joseph. Talking with the programmer again.

Ok so, FMOD studio itself doesn’t have rigid body logic, but do the unity integration scripts, such as the fmod studio emitter, have any functionality to provide velocity as a useable value?

Is there a script that natively provides the velocity value of the fmod emitter relative to the listener, or do we have to make that ourselves?

Have you tried setting the Rigidbody property isKinematic to true, or using Rigidbody methods that allow Unity’s physics system to handle movement, such as Rigidbody.AddForce()? As described in the section on this topic of the Troubleshooting chapter of the FMOD for Unity documentation, doing so should ensure that the velocity is automatically calculated.

My programmer said -
"We can’t use kinematic rigidbodies, but we are allowing them to move via physics. Theoretically it should already be working.

Maybe we just missed something?

Thanks for the replies joseph.

My programmer said -
"We can’t use kinematic rigidbodies, but we are allowing them to move via physics. Theoretically it should already be working.

Maybe we just missed something?

It should be noted that our emitters are children of the rigidbodies, but not directly attached. Would that have any effect?

Aha, that could well be it! Emitters only check for rigidbodies attached to the same gameobject, not their parent objects.

You should be able to work around this by enabling the emitter’s “allow non-rigidbody doppler” setting.