2021-04-09 01:18:16 (edited by frastlin 2021-04-09 01:33:37)

Hello,
In an environment where the player can move at any increment and rotate (using HRTF), how does one create a wall of sound such as a road or river? How does one create two walls of sound that are perpendicular to one another at different angles like two roads meeting one another? How does one create a wall that goes diagonally from ahead and to the right of the player to behind and to the left of the player like someone facing a river at a slant (not a right angle)?
Vg Storm has played a little with this in an environment of right angles and fixed orientation, but I'm wondering if anyone has thoughts of how to do something similar with a more complex environment?
Here is a Stack Overflow question I posted on this topic that has some ideas on how one would do this, but none of the ideas really solve the problem.
Please let me know your thoughts!

2021-04-09 01:24:57

Do you mean HRTF?  If you mean HRTF, then speaking as the resident HRTF expert, it kind of can't be done.  You can do a good enough job that sighted people will be satisfied when combining it with sight and find it realistic, but no one has yet shown me a volumetric demo where I go "wow, that actually sounds like a river and it's totally right there", the best you get is "it's big and vaguely to the left".  overall it's interesting to talk to sighted people about this because they combine it with graphics without even knowing, then start in on "but your HRTF library isn't good" and it's like "if you closed your eyes when looking at the Oculus demo..." but that's beside the point.  There's a reason that everyone does a Swamp-style radar and, though I've tossed a lot of ideas around about this, I don't think it's possible to do better.

My Blog
Twitter: @ajhicks1992

2021-04-09 01:38:16

Yes, using HRTF. Fascinating, what approach do you think is the best sounding?

2021-04-09 01:48:31

There are ways to fake it. Onslaught has audio walls you can sort of fly along. I have an invisible square of lines around the field, and raycast out from the player in each cardinal direction, positioning a sound source wherever the ray intersects the square. That was for actual navigation, so in that sense it made sense to have 4 rays. For sound-emitting shapes, you could probably do some sort of nearest point calculation between the player and the geometry, then position the sound source for the object at that point. That would get you a river that emits sound directionally and loudly, but that dropped off and changed direction as you moved away from its exact shape.

Another way to fake it would be positioning sound sources every few units along the shape of the object, and tuning their parameters so they drop off somewhat quickly as you move away. You have to manage your sound resources a bit more carefully and not just spawn a thousand sounds for your river (unless your library can handle that, of course.) If you think about it, though, a river is rarely a uniform wall of sound, and this lets you play with tuning your audio environment. Your river might be one loud waterfall that can be heard from further away, and bunches of quieter sections of water on rocks, maybe a few rapids, another smaller waterfall, water running under a bridge, etc. You can make an ocean shore sound much nicer if you, say, place your basic crashing waves sound every few units, and stagger their start times such that the samples start at different times and you actually hear multiple waves crashing at once. I was amazed at how this transformed a basic "crashing waves" sample from something that sounded a bit uninspired, to a beach with actual waves that I could hear crashing in front of me, then shifted to my right as I walked along.

Hope that helps. I think I posted something similar a few years back and got answers similar to my first suggestion about faking it, so that may be the state of the art.

2021-04-09 01:56:32

Well, pick your proprietary platform that doesn't publish how they do it.  Steam's is okay.  Oculus's is okay.  But the reason I'm writing my own is that normally the ones by/for sighted people sacrifice precision for cheap computational power and tricks and things (save me from ambisonics, for the love of god).

The thing about volumetric sources is that volume is conveyed by a lot of other stuff.   You don't just hear with your ears.  You actually hear with your whole body.  Temperature differences, wind, vibration through the ground, pressure in the air, all of these things matter.  Put on headphones and you've given all of that up.  Then add in the fact that HRTF in general isn't individualized to you and there's that disconnect.  And at the end of that you end up with--it's not quite binary.  But it's, at best just a slider that says "vaguely big" vs. "definitely not big".  In theory I could get you "big and somewhere in front and to the right" but you're never going to get shape out of it really, not by itself.  you'd have to like animate the sources and make them move around and things like that, which you can, Synthizer is fast enough to let you for one thing and OpenALSoft probably is too, but as soon as you say that anything big is 10-20 moving sources you're eating a ton of processing power so you can only get a couple things like that per scene.  Plus, you'll have to feed each of those animated sources different audio, or they just converge into one.  And even after all that it's going to be kind of obviously artificial.

But mind you, "here's a source for each train car" probably works out super well even without volumetric anything.  Maybe I should do that as a demo, actually.

But you won't get it to the point where it's really useful for navigation or anything like that, and you probably have to buy it.  No one in OSS land has it to my knowledge unless OpenALSoft did it since I last looked.  But even if you did pay for it the best you can do is "vaguely big, and we always put the source on the closest point to the player so that they know if they're close to the edge".  it's just not solvable unless you give me some sort of amazing full-body vr chamber if you want it to sound natural.

Which puts us back at "give the player a radar".  If you want something navigable then the player will need unnatural-sounding tools to do it with.  There's no real way around this.  So, the answer is yes if you just want it to sound cool, but definitely not if you want players to be able to follow the river without some auxiliary thing to tell them where the path is.

My Blog
Twitter: @ajhicks1992