setRemoteVoicePosition abstract method
Sets the 2D position (the position on the horizontal plane) of the remote user's voice. This method sets the 2D position and volume of a remote user, so that the local user can easily hear and identify the remote user's position. When the local user calls this method to set the voice position of a remote user, the voice difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a sense of space. This method applies to massive multiplayer online games, such as Battle Royale games. For this method to work, enable stereo panning for remote users by calling the enableSoundPositionIndication method before joining a channel. For the best voice positioning, Agora recommends using a wired headset. Call this method after joining a channel.
Param uid
The user ID of the remote user.
Param pan
The voice position of the remote user. The value ranges from -1.0 to 1.0: 0.0: (Default) The remote voice comes from the front.
-1.0: The remote voice comes from the left.
1.0: The remote voice comes from the right.
Param gain
The volume of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original volume of the remote user). The smaller the value, the lower the volume.
Implementation
Future<void> setRemoteVoicePosition(int uid, double pan, double gain);