setRemoteAudioAttenuation abstract method

Future<void> setRemoteAudioAttenuation({
  1. required int uid,
  2. required double attenuation,
  3. required bool forceSet,
})

Sets the sound attenuation effect for the specified user.

  • uid The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.
  • attenuation For the user's sound attenuation coefficient, the value range is 0,1. The values are as follows: 0: Broadcast mode, where the volume and timbre are not attenuated with distance, and the volume and timbre heard by local users do not change regardless of distance. (0,0.5): Weak attenuation mode, that is, the volume and timbre are only weakly attenuated during the propagation process, and the sound can travel farther than the real environment. 0.5: (Default) simulates the attenuation of the volume in the real environment; the effect is equivalent to not setting the speaker_attenuation parameter. (0.5,1]: Strong attenuation mode, that is, the volume and timbre attenuate rapidly during the propagation process.
  • forceSet Whether to force the user's sound attenuation effect: true : Force attenuation to set the sound attenuation of the user. At this time, the attenuation coefficient of the sound insulation area set in the audioAttenuation of the SpatialAudioZone does not take effect for the user. If the sound source and listener are inside and outside the sound isolation area, the sound attenuation effect is determined by the audioAttenuation in SpatialAudioZone. If the sound source and the listener are in the same sound insulation area or outside the same sound insulation area, the sound attenuation effect is determined by attenuation in this method. false : Do not force attenuation to set the user's sound attenuation effect, as shown in the following two cases.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly.

Implementation

Future<void> setRemoteAudioAttenuation(
    {required int uid, required double attenuation, required bool forceSet});