FMOD_3D_Attributes: Discontinuity when passing through X = 0

I’m using 3D Sound via the FMOD Studio API, adjusting the active sound event’s 3D Attributes.

As a test, I am launching a “tank moving” sound (application is a WWII game), starting to my left (X = -20) and moving to my right (X = +20). The test is to see if, with stereo speakers, I can hear the movement from left to right.

The answer = Yes!

But… I am getting a very noticeable “discontinuity” when the sound position passes through the middle (X = 0). The right speaker jumps up dramatically at that point, and the left drops off similarly. It’s a very jarring effect, and not what we need in the game.

Interestingly, the discontinuity is far less noticeable when Y = 0 (i.e. the tank passes right through the listener, who is at (0,0)). But it is VERY noticeable when Y <> 0. In fact, if anything it gets worse for higher Y (farther in front of the listener).

Any thoughts what might be causing this? If there is someplace I can post a file, I can upload a sound clip and image of the channels output to demo the issue.

Thanks for the report, there is certainly an edge case there. When a sound passes through the position of the listener we perform “envelopment” to smoothen the transition of the sound to avoid speaker flipping. However it doesn’t consider the sound source crossing the listener if it’s very high above or very low below.

I’ve logged a task to investigate whether we can use the same envelopment technique for the above and below cases. For now I suggest trying different min/max distance setups to mitigate how audible this is or avoid having sounds positioned in this arrangement.

mathew, thank you for the reply!

Let me make sure I am understanding the coordinate system, or at least how I am using it:

A 3D attribute consists of: position, velocity, forward, and up vectors

I am not modeling doppler (yet anyway) so I really don’t care about velocity, forward or up vectors. All I really care about right now is position.

So for every frame (these never change) I have:
velocity = (0, 0, 0)
forward = (1, 0, 0)
up = (0, 0, 1)

All I do is update the position vector every frame and listen to the result. The listener I presume defaults to (0, 0, 0) which I leave unchanged.

Our application is basically a 2D map (no altitude). So I am orienting our 3D space as follows:
X = left/right, Y = front/behind, Z = 0 (nothing above or below)

My test is simple:
I have a sound event that begins at (-20, 0, 0) and incrementally moves to (+20, 0, 0)

The maxdistance for this sound event is 20, so initially the listener hears nothing, then it slowly builds from the left, crosses through the listener position, and moves to the right until it fades away.

As you say in your response, this works perfectly if it crosses the listener position!

But even a small change in Y causes a very distinct “speaker flip”. If I run the same test with Y = 1 i.e. (-20, 1, 0) -> (+20, 1, 0) there is a very audible flip at (0,1,0).

I’m not understanding how Y = 1, with a maxdistance of 20, can be considered an “edge case”. In our scale, that’s like an object crossing in front of me by perhaps 10 meters. It’s certainly not very far away!

How are others dealing with 3D modeling of sound from objects moving close to their position but not
right through them? This feels like such a fundamental 3D sound requirement that I must be missing something in the application of the attributes?

Thanks!

The edge case I described was for when sounds are quite far above, so not the case you are describing here.

Firstly it’s worth reading our docs section on handedness to ensure you are in the same coordinate space as us. Also the listener will default to 0,0,0 for position, forward is +Z and up is +Y.

When FMOD calculates automatic envelopment for sounds passing near or through the listener, this calculation is done based on the minimum distance or sound size. Please let me know which envelopment mode you have your spatializer set to, user, auto or off, also the values for min distance / sound size and min extent. If the sound size is tiny for instance, you may jump completely over the region where the envelopment is smoothed giving a sharp panning transition.