Repository navigation
Add the option to apply an interaural time difference to AudioStreamPlayer3D nodes for better 3D audio.
#15720
echo-lalia
started this conversation in
3D
Replies: 1 comment
|
Also, quick side note: I did search for related issues, and found this issue discussing the addition of a new resource type for custom audio spacialization models, which mentions interaural delay in passing. This issue doesn't actually seem to be asking for the current behaviour to be changed, but I am :) |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
TLDR:
Godot 3D audio sounds like this, but I think it should sound like this.
From Wikipedia: The interaural time difference (or ITD) when concerning humans or animals, is the difference in arrival time of a sound between two ears. It is important in the localization of sounds, as it provides a cue to the direction or angle of the sound source from the head. If a signal arrives at the head from one side, the signal has further to travel to reach the far ear than the near ear. This pathlength difference results in a time difference between the sound's arrivals at the ears, which is detected and aids the process of identifying the direction of sound source.
Currently, Godot's
AudioStreamPlayer3DandAudioListener3Duse only panning to clue you in to what direction a sound is coming from, which creates a very weak illusion of spacial direction for 3D audio.However, interaural time differences are much more important for creating the illusion of 3d audio, and Godot doesn't provide a built-in way to create that effect.
I whipped up 3 demo samples in Audacity to showcase this:
The first example mimics what Godot already does if an AudioStreamPlayer3D if far to your left. To my ears, it sounds like the drop is coming from the center of my head, just slightly to the left.
The second example is what I'm asking to be added. To my ears, it sounds like the drop is coming from the far left, providing a much stronger spatial effect than the first.
The third example is just here to showcase the difference in "feel" between the panning effect and the interaural effect (the sound is panned to the left, but the right plays first). To my ears, it sounds like the sound is coming slightly from my right, but with something obstructing the sound. (This is also what it sounds like currently when you use a stereo audio sample with an
AudioStreamPlayer3Dnode, and the directionality of the sample conflicts with the direction of the audio in-game)This issue can't fully be overcome through custom scripts, because the changes to the delay need to be made more smoothly than 60 FPS allows. But if you're okay with some crackling, a script with separate audio buses and
AudioEffectDelays for eachAudioStreamPlayer3Dgets close. Here's a small snippet from a recent project of mine that added this effect in a simplified way:(EDIT: I also built the above script into a separate example to show off both the intended effect, and the crackling that comes with updating it through a script).
However, I personally think this should be added directly into Godot's built-in 3D audio nodes, because this is the minimum requirement for audio to actually sound 3D, and I think that most users of the
AudioStreamPlayer3DandAudioListener3Dnodes would be hoping to achieve this kind of directional effect.I'm suggesting this being added as an option just for compatibility reasons, but I don't think the average user would actually want this option disabled.
All reactions