Propagation of sound in space

In Unity I hear sound immediatly after it is fired but instance of sound and listener are not very close. But speed of sound should be 343 m/s. What should I do to fix this no delay?

FMOD and the FMOD Spatializer effect do not model speed-of-sound propagation. There are a number of ways to handle it, but if you’re looking to simulate speed-of-sound propagation as well as other features like HRTF and early reflections, the simplest way would be to use a third-party spatializer plugin that does handle some or all of these features - for example, Steam Audio, Resonance Audio, Oculus Audio, etc.

1 Like

Could You help me with Steam Audio Spatializer? I don’t see how to setup speed of sound in air there.

My apologies, I had assumed Steam Audio handled speed-of-sound propagation - while it does handle other aspects of propagation, it seems like doesn’t handle that.

To handle it yourself, you can do a few things:

  • If an event will always be a static distance from the listener, you can set a delay on its instruments, or on an event instrument containing the event itself in a parent event
  • If you need to handle it dynamically, the simplest way would be to delay starting an event instance from your own code based on time elapsed

That said, I’ve added some means of handling speed-of-sound propagation to our feature/improvement tracker.

2 Likes

That would be a very welcome improvement! Looking forward to any updates on this.

I don’t have any updates to offer at the moment, but I’ve noted your interest internally.

+1, but a few comments for @yurii.seredovych

Don’t know what kind of game you’re making, but there’s a reason games might not use a delay on things like muzzle flashes from distant gunfire, which is that bullets can travel faster than the speed of sound, and in a game setting (the worth and effectiveness of a game not always equal to how real they are) it might feel odd to get hit by a bullet then hear the shot.

I can see the benefit of doing this in code even if there was a speed-of-sound propagation function in FMOD. For example, a distant bomb going off, delayed audio and a shockwave that hits you at the same time, where the shockwave causes camera shake and triggers a gameplay mechanic like slowing down the player, and triggers a haptic. If the programmer can sync all those at the same time, great. On the other hand, if they want to adjust the rate of that shockwave to be faster or slower for some reason, they can do everything except for audio, and have to ask you to adjust your delay each time they want to test for the delay time that feels the best in game.

1 Like