This isn’t a truly global solution. You can still bypass the new behavior by using AudioStreamPlayer3D instead of AudioStreamPlayer3DWithDelay, or by calling playinstead of play_with_delay. It is, however, centralized. All of the new functionality is encapsulated in one method of one class. If you want to adjust the way the delay is calculated or disable it entirely, there is only method you need to change. That’s close enough to global for most practical purposes.
It’s raytrace audio for Godot.
The delay for distant sounds itself is not mentioned. I have asked in the comments of the video, no response so far.
But it has reverb based on the scene geometry. So it calculates speed of sound in some way.
Yeah, it’s observable at sub-second distances if the audio/visual “signal” looks like a pulse, i.e. there is a pronounced abrupt change, precisely like hitting a baseball with a bat or the clap @conz3d mentioned.
Got an answer from the developer of the Raytraced Audio:
This plugin doesn’t delay sounds, but it wouldn’t be difficult to implement: check the distance from the sound to the player, then divide by the speed of sound and delay playing the sound by that much. No fancy raytracing needed
In Hollywood movies there is only a delay in huge explosions, when there is a shock wave (pressure wave) visible, and the sound plays when the wave hits the camera.
I’m doubtful an example could easily be found that does literally that, although there may be some. A visual of an explosion without any sound is totally underwhelming. And we don’t want that in games or movies. The only thing that comes to mind is a nuke detonation from Oppenheimer, but that was completely silent, presumably for poetic reasons.
What is typically seen is a muffled sound that’s fully synched with the blast and then a clear sound when/if the shockwave reaches the camera. Case in point (the only one I can remember now): the destruction of Jedha in Rogue One.
I didn’t like either of the movies I used as examples here
Terminator and “The day after” etc. where you have a N. explosion, with a clear ring of the shock wave on the ground, and the time of impact is way over a second. There the sound plays on impact of the wave.
I’m with you that in most cases the delay would feel like a bug. But maybe with some fine tuning of the logic with a visual shock wave up to the point where the sound plays could have an interesting effect. Would need some prototyping what could be the lower limit of a meaningful distance. Just delaying the sound seems bad, but combined with some visual effect, there could be something.
Yeah it can be made to work although that’s harder to pull off in a game than in a movie (unless it’s a cutscene) as you don’t have the control over framing and editing/timing.
I found one neat example. It’s from Indiana Jones and the Kingdom of the Crystal Skull. When a nuke detonates, we only see a kitchen interior and an intense silent flash through the window. So the explosion is depicted in an indirect way. The silence wouldn’t work that well if the explosion itself was the main and only subject in the shot, and if there wasn’t a strong audiovisual contrast to the silence when the shockwave finally arrives.