Scenario
When you want to eliminate the left-to-right stereo panning of voice chat (audio shifting between left and right ears based on listener facing direction), but still wishes to calculate the change in perceived loudness based on the distance between the speaking and listening player.
Resolution
You can eliminate the audio panning effect by adjusting the values used when calling Set3DPosition. In most Vivox SDKs this can be done by using the player object's Up vector as the argument for both the Up vector (as normal) and also the Forward/At vector.
Unity 15.x
Set3DPosition(speaker.position, listener.position, listener.up, listener.up);
Unity 16.x
Both variants of the method Set3DPosition()
have an optional parameter bool allowPanning
which controls this: pass in a value of false
to disallow panning.
Unreal
Set3DPosition(ActorLocation, ActorLocation, ActorUpVector, ActorUpVector)
Core
vx_req_session_set_3d_position *req;
vx_req_session_set_3d_position_create(&req);
req->session_handle = vx_strdup("mychannel");
req->req_disposition_type = req_disposition_no_reply_required;
req->speaker_position[0] = 10;
req->speaker_position[1] = 0;
req->speaker_position[2] = 0;
req->listener_position[0] = 10;
req->listener_position[1] = 0;
req->listener_position[2] = 0;
req->listener_at_orientation[0] = 0;
req->listener_at_orientation[1] = 1;
req->listener_at_orientation[2] = 0;
req->listener_up_orientation[0] = 0;
req->listener_up_orientation[1] = 1;
req->listener_up_orientation[2] = 0;
vx_issue_request3(&req->base);